{-# 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.SecurityHub.Types.Network where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.NetworkDirection
import Amazonka.SecurityHub.Types.PortRange
data Network = Network'
{
Network -> Maybe Text
destinationDomain :: Prelude.Maybe Prelude.Text,
Network -> Maybe Int
sourcePort :: Prelude.Maybe Prelude.Int,
Network -> Maybe PortRange
openPortRange :: Prelude.Maybe PortRange,
Network -> Maybe Text
sourceMac :: Prelude.Maybe Prelude.Text,
Network -> Maybe NetworkDirection
direction :: Prelude.Maybe NetworkDirection,
Network -> Maybe Text
destinationIpV6 :: Prelude.Maybe Prelude.Text,
Network -> Maybe Text
protocol :: Prelude.Maybe Prelude.Text,
Network -> Maybe Text
sourceIpV6 :: Prelude.Maybe Prelude.Text,
Network -> Maybe Text
destinationIpV4 :: Prelude.Maybe Prelude.Text,
Network -> Maybe Text
sourceDomain :: Prelude.Maybe Prelude.Text,
Network -> Maybe Int
destinationPort :: Prelude.Maybe Prelude.Int,
Network -> Maybe Text
sourceIpV4 :: Prelude.Maybe Prelude.Text
}
deriving (Network -> Network -> Bool
(Network -> Network -> Bool)
-> (Network -> Network -> Bool) -> Eq Network
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Network -> Network -> Bool
$c/= :: Network -> Network -> Bool
== :: Network -> Network -> Bool
$c== :: Network -> Network -> Bool
Prelude.Eq, ReadPrec [Network]
ReadPrec Network
Int -> ReadS Network
ReadS [Network]
(Int -> ReadS Network)
-> ReadS [Network]
-> ReadPrec Network
-> ReadPrec [Network]
-> Read Network
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Network]
$creadListPrec :: ReadPrec [Network]
readPrec :: ReadPrec Network
$creadPrec :: ReadPrec Network
readList :: ReadS [Network]
$creadList :: ReadS [Network]
readsPrec :: Int -> ReadS Network
$creadsPrec :: Int -> ReadS Network
Prelude.Read, Int -> Network -> ShowS
[Network] -> ShowS
Network -> String
(Int -> Network -> ShowS)
-> (Network -> String) -> ([Network] -> ShowS) -> Show Network
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Network] -> ShowS
$cshowList :: [Network] -> ShowS
show :: Network -> String
$cshow :: Network -> String
showsPrec :: Int -> Network -> ShowS
$cshowsPrec :: Int -> Network -> ShowS
Prelude.Show, (forall x. Network -> Rep Network x)
-> (forall x. Rep Network x -> Network) -> Generic Network
forall x. Rep Network x -> Network
forall x. Network -> Rep Network x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Network x -> Network
$cfrom :: forall x. Network -> Rep Network x
Prelude.Generic)
newNetwork ::
Network
newNetwork :: Network
newNetwork =
Network' :: Maybe Text
-> Maybe Int
-> Maybe PortRange
-> Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network
Network'
{ $sel:destinationDomain:Network' :: Maybe Text
destinationDomain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourcePort:Network' :: Maybe Int
sourcePort = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:openPortRange:Network' :: Maybe PortRange
openPortRange = Maybe PortRange
forall a. Maybe a
Prelude.Nothing,
$sel:sourceMac:Network' :: Maybe Text
sourceMac = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:direction:Network' :: Maybe NetworkDirection
direction = Maybe NetworkDirection
forall a. Maybe a
Prelude.Nothing,
$sel:destinationIpV6:Network' :: Maybe Text
destinationIpV6 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:protocol:Network' :: Maybe Text
protocol = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceIpV6:Network' :: Maybe Text
sourceIpV6 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationIpV4:Network' :: Maybe Text
destinationIpV4 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceDomain:Network' :: Maybe Text
sourceDomain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationPort:Network' :: Maybe Int
destinationPort = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:sourceIpV4:Network' :: Maybe Text
sourceIpV4 = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
network_destinationDomain :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_destinationDomain :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_destinationDomain = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
destinationDomain :: Maybe Text
$sel:destinationDomain:Network' :: Network -> Maybe Text
destinationDomain} -> Maybe Text
destinationDomain) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:destinationDomain:Network' :: Maybe Text
destinationDomain = Maybe Text
a} :: Network)
network_sourcePort :: Lens.Lens' Network (Prelude.Maybe Prelude.Int)
network_sourcePort :: (Maybe Int -> f (Maybe Int)) -> Network -> f Network
network_sourcePort = (Network -> Maybe Int)
-> (Network -> Maybe Int -> Network)
-> Lens Network Network (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Int
sourcePort :: Maybe Int
$sel:sourcePort:Network' :: Network -> Maybe Int
sourcePort} -> Maybe Int
sourcePort) (\s :: Network
s@Network' {} Maybe Int
a -> Network
s {$sel:sourcePort:Network' :: Maybe Int
sourcePort = Maybe Int
a} :: Network)
network_openPortRange :: Lens.Lens' Network (Prelude.Maybe PortRange)
network_openPortRange :: (Maybe PortRange -> f (Maybe PortRange)) -> Network -> f Network
network_openPortRange = (Network -> Maybe PortRange)
-> (Network -> Maybe PortRange -> Network)
-> Lens Network Network (Maybe PortRange) (Maybe PortRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe PortRange
openPortRange :: Maybe PortRange
$sel:openPortRange:Network' :: Network -> Maybe PortRange
openPortRange} -> Maybe PortRange
openPortRange) (\s :: Network
s@Network' {} Maybe PortRange
a -> Network
s {$sel:openPortRange:Network' :: Maybe PortRange
openPortRange = Maybe PortRange
a} :: Network)
network_sourceMac :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_sourceMac :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_sourceMac = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
sourceMac :: Maybe Text
$sel:sourceMac:Network' :: Network -> Maybe Text
sourceMac} -> Maybe Text
sourceMac) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:sourceMac:Network' :: Maybe Text
sourceMac = Maybe Text
a} :: Network)
network_direction :: Lens.Lens' Network (Prelude.Maybe NetworkDirection)
network_direction :: (Maybe NetworkDirection -> f (Maybe NetworkDirection))
-> Network -> f Network
network_direction = (Network -> Maybe NetworkDirection)
-> (Network -> Maybe NetworkDirection -> Network)
-> Lens
Network Network (Maybe NetworkDirection) (Maybe NetworkDirection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe NetworkDirection
direction :: Maybe NetworkDirection
$sel:direction:Network' :: Network -> Maybe NetworkDirection
direction} -> Maybe NetworkDirection
direction) (\s :: Network
s@Network' {} Maybe NetworkDirection
a -> Network
s {$sel:direction:Network' :: Maybe NetworkDirection
direction = Maybe NetworkDirection
a} :: Network)
network_destinationIpV6 :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_destinationIpV6 :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_destinationIpV6 = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
destinationIpV6 :: Maybe Text
$sel:destinationIpV6:Network' :: Network -> Maybe Text
destinationIpV6} -> Maybe Text
destinationIpV6) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:destinationIpV6:Network' :: Maybe Text
destinationIpV6 = Maybe Text
a} :: Network)
network_protocol :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_protocol :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_protocol = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
protocol :: Maybe Text
$sel:protocol:Network' :: Network -> Maybe Text
protocol} -> Maybe Text
protocol) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:protocol:Network' :: Maybe Text
protocol = Maybe Text
a} :: Network)
network_sourceIpV6 :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_sourceIpV6 :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_sourceIpV6 = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
sourceIpV6 :: Maybe Text
$sel:sourceIpV6:Network' :: Network -> Maybe Text
sourceIpV6} -> Maybe Text
sourceIpV6) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:sourceIpV6:Network' :: Maybe Text
sourceIpV6 = Maybe Text
a} :: Network)
network_destinationIpV4 :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_destinationIpV4 :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_destinationIpV4 = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
destinationIpV4 :: Maybe Text
$sel:destinationIpV4:Network' :: Network -> Maybe Text
destinationIpV4} -> Maybe Text
destinationIpV4) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:destinationIpV4:Network' :: Maybe Text
destinationIpV4 = Maybe Text
a} :: Network)
network_sourceDomain :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_sourceDomain :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_sourceDomain = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
sourceDomain :: Maybe Text
$sel:sourceDomain:Network' :: Network -> Maybe Text
sourceDomain} -> Maybe Text
sourceDomain) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:sourceDomain:Network' :: Maybe Text
sourceDomain = Maybe Text
a} :: Network)
network_destinationPort :: Lens.Lens' Network (Prelude.Maybe Prelude.Int)
network_destinationPort :: (Maybe Int -> f (Maybe Int)) -> Network -> f Network
network_destinationPort = (Network -> Maybe Int)
-> (Network -> Maybe Int -> Network)
-> Lens Network Network (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Int
destinationPort :: Maybe Int
$sel:destinationPort:Network' :: Network -> Maybe Int
destinationPort} -> Maybe Int
destinationPort) (\s :: Network
s@Network' {} Maybe Int
a -> Network
s {$sel:destinationPort:Network' :: Maybe Int
destinationPort = Maybe Int
a} :: Network)
network_sourceIpV4 :: Lens.Lens' Network (Prelude.Maybe Prelude.Text)
network_sourceIpV4 :: (Maybe Text -> f (Maybe Text)) -> Network -> f Network
network_sourceIpV4 = (Network -> Maybe Text)
-> (Network -> Maybe Text -> Network)
-> Lens Network Network (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Network' {Maybe Text
sourceIpV4 :: Maybe Text
$sel:sourceIpV4:Network' :: Network -> Maybe Text
sourceIpV4} -> Maybe Text
sourceIpV4) (\s :: Network
s@Network' {} Maybe Text
a -> Network
s {$sel:sourceIpV4:Network' :: Maybe Text
sourceIpV4 = Maybe Text
a} :: Network)
instance Core.FromJSON Network where
parseJSON :: Value -> Parser Network
parseJSON =
String -> (Object -> Parser Network) -> Value -> Parser Network
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Network"
( \Object
x ->
Maybe Text
-> Maybe Int
-> Maybe PortRange
-> Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network
Network'
(Maybe Text
-> Maybe Int
-> Maybe PortRange
-> Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe PortRange
-> Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
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
"DestinationDomain")
Parser
(Maybe Int
-> Maybe PortRange
-> Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
-> Parser (Maybe Int)
-> Parser
(Maybe PortRange
-> Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SourcePort")
Parser
(Maybe PortRange
-> Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
-> Parser (Maybe PortRange)
-> Parser
(Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PortRange)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OpenPortRange")
Parser
(Maybe Text
-> Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
-> Parser (Maybe Text)
-> Parser
(Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
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
"SourceMac")
Parser
(Maybe NetworkDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
-> Parser (Maybe NetworkDirection)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkDirection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Direction")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
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
"DestinationIpV6")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Network)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> Maybe Text -> Network)
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
"Protocol")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> Maybe Text -> Network)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Int -> Maybe Text -> Network)
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
"SourceIpV6")
Parser
(Maybe Text -> Maybe Text -> Maybe Int -> Maybe Text -> Network)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> Maybe Text -> Network)
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
"DestinationIpV4")
Parser (Maybe Text -> Maybe Int -> Maybe Text -> Network)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> Network)
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
"SourceDomain")
Parser (Maybe Int -> Maybe Text -> Network)
-> Parser (Maybe Int) -> Parser (Maybe Text -> Network)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DestinationPort")
Parser (Maybe Text -> Network)
-> Parser (Maybe Text) -> Parser Network
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
"SourceIpV4")
)
instance Prelude.Hashable Network
instance Prelude.NFData Network
instance Core.ToJSON Network where
toJSON :: Network -> Value
toJSON Network' {Maybe Int
Maybe Text
Maybe NetworkDirection
Maybe PortRange
sourceIpV4 :: Maybe Text
destinationPort :: Maybe Int
sourceDomain :: Maybe Text
destinationIpV4 :: Maybe Text
sourceIpV6 :: Maybe Text
protocol :: Maybe Text
destinationIpV6 :: Maybe Text
direction :: Maybe NetworkDirection
sourceMac :: Maybe Text
openPortRange :: Maybe PortRange
sourcePort :: Maybe Int
destinationDomain :: Maybe Text
$sel:sourceIpV4:Network' :: Network -> Maybe Text
$sel:destinationPort:Network' :: Network -> Maybe Int
$sel:sourceDomain:Network' :: Network -> Maybe Text
$sel:destinationIpV4:Network' :: Network -> Maybe Text
$sel:sourceIpV6:Network' :: Network -> Maybe Text
$sel:protocol:Network' :: Network -> Maybe Text
$sel:destinationIpV6:Network' :: Network -> Maybe Text
$sel:direction:Network' :: Network -> Maybe NetworkDirection
$sel:sourceMac:Network' :: Network -> Maybe Text
$sel:openPortRange:Network' :: Network -> Maybe PortRange
$sel:sourcePort:Network' :: Network -> Maybe Int
$sel:destinationDomain:Network' :: Network -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DestinationDomain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
destinationDomain,
(Text
"SourcePort" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
sourcePort,
(Text
"OpenPortRange" Text -> PortRange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PortRange -> Pair) -> Maybe PortRange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PortRange
openPortRange,
(Text
"SourceMac" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceMac,
(Text
"Direction" Text -> NetworkDirection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NetworkDirection -> Pair) -> Maybe NetworkDirection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkDirection
direction,
(Text
"DestinationIpV6" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
destinationIpV6,
(Text
"Protocol" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
protocol,
(Text
"SourceIpV6" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceIpV6,
(Text
"DestinationIpV4" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
destinationIpV4,
(Text
"SourceDomain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceDomain,
(Text
"DestinationPort" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
destinationPort,
(Text
"SourceIpV4" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceIpV4
]
)