{-# 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.ProcessDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProcessDetails = ProcessDetails'
{
ProcessDetails -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
ProcessDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ProcessDetails -> Maybe Int
pid :: Prelude.Maybe Prelude.Int,
ProcessDetails -> Maybe Text
terminatedAt :: Prelude.Maybe Prelude.Text,
ProcessDetails -> Maybe Int
parentPid :: Prelude.Maybe Prelude.Int,
ProcessDetails -> Maybe Text
launchedAt :: Prelude.Maybe Prelude.Text
}
deriving (ProcessDetails -> ProcessDetails -> Bool
(ProcessDetails -> ProcessDetails -> Bool)
-> (ProcessDetails -> ProcessDetails -> Bool) -> Eq ProcessDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProcessDetails -> ProcessDetails -> Bool
$c/= :: ProcessDetails -> ProcessDetails -> Bool
== :: ProcessDetails -> ProcessDetails -> Bool
$c== :: ProcessDetails -> ProcessDetails -> Bool
Prelude.Eq, ReadPrec [ProcessDetails]
ReadPrec ProcessDetails
Int -> ReadS ProcessDetails
ReadS [ProcessDetails]
(Int -> ReadS ProcessDetails)
-> ReadS [ProcessDetails]
-> ReadPrec ProcessDetails
-> ReadPrec [ProcessDetails]
-> Read ProcessDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProcessDetails]
$creadListPrec :: ReadPrec [ProcessDetails]
readPrec :: ReadPrec ProcessDetails
$creadPrec :: ReadPrec ProcessDetails
readList :: ReadS [ProcessDetails]
$creadList :: ReadS [ProcessDetails]
readsPrec :: Int -> ReadS ProcessDetails
$creadsPrec :: Int -> ReadS ProcessDetails
Prelude.Read, Int -> ProcessDetails -> ShowS
[ProcessDetails] -> ShowS
ProcessDetails -> String
(Int -> ProcessDetails -> ShowS)
-> (ProcessDetails -> String)
-> ([ProcessDetails] -> ShowS)
-> Show ProcessDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProcessDetails] -> ShowS
$cshowList :: [ProcessDetails] -> ShowS
show :: ProcessDetails -> String
$cshow :: ProcessDetails -> String
showsPrec :: Int -> ProcessDetails -> ShowS
$cshowsPrec :: Int -> ProcessDetails -> ShowS
Prelude.Show, (forall x. ProcessDetails -> Rep ProcessDetails x)
-> (forall x. Rep ProcessDetails x -> ProcessDetails)
-> Generic ProcessDetails
forall x. Rep ProcessDetails x -> ProcessDetails
forall x. ProcessDetails -> Rep ProcessDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProcessDetails x -> ProcessDetails
$cfrom :: forall x. ProcessDetails -> Rep ProcessDetails x
Prelude.Generic)
newProcessDetails ::
ProcessDetails
newProcessDetails :: ProcessDetails
newProcessDetails =
ProcessDetails' :: Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ProcessDetails
ProcessDetails'
{ $sel:path:ProcessDetails' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ProcessDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pid:ProcessDetails' :: Maybe Int
pid = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:terminatedAt:ProcessDetails' :: Maybe Text
terminatedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parentPid:ProcessDetails' :: Maybe Int
parentPid = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:launchedAt:ProcessDetails' :: Maybe Text
launchedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
processDetails_path :: Lens.Lens' ProcessDetails (Prelude.Maybe Prelude.Text)
processDetails_path :: (Maybe Text -> f (Maybe Text))
-> ProcessDetails -> f ProcessDetails
processDetails_path = (ProcessDetails -> Maybe Text)
-> (ProcessDetails -> Maybe Text -> ProcessDetails)
-> Lens ProcessDetails ProcessDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessDetails' {Maybe Text
path :: Maybe Text
$sel:path:ProcessDetails' :: ProcessDetails -> Maybe Text
path} -> Maybe Text
path) (\s :: ProcessDetails
s@ProcessDetails' {} Maybe Text
a -> ProcessDetails
s {$sel:path:ProcessDetails' :: Maybe Text
path = Maybe Text
a} :: ProcessDetails)
processDetails_name :: Lens.Lens' ProcessDetails (Prelude.Maybe Prelude.Text)
processDetails_name :: (Maybe Text -> f (Maybe Text))
-> ProcessDetails -> f ProcessDetails
processDetails_name = (ProcessDetails -> Maybe Text)
-> (ProcessDetails -> Maybe Text -> ProcessDetails)
-> Lens ProcessDetails ProcessDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessDetails' {Maybe Text
name :: Maybe Text
$sel:name:ProcessDetails' :: ProcessDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: ProcessDetails
s@ProcessDetails' {} Maybe Text
a -> ProcessDetails
s {$sel:name:ProcessDetails' :: Maybe Text
name = Maybe Text
a} :: ProcessDetails)
processDetails_pid :: Lens.Lens' ProcessDetails (Prelude.Maybe Prelude.Int)
processDetails_pid :: (Maybe Int -> f (Maybe Int)) -> ProcessDetails -> f ProcessDetails
processDetails_pid = (ProcessDetails -> Maybe Int)
-> (ProcessDetails -> Maybe Int -> ProcessDetails)
-> Lens ProcessDetails ProcessDetails (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessDetails' {Maybe Int
pid :: Maybe Int
$sel:pid:ProcessDetails' :: ProcessDetails -> Maybe Int
pid} -> Maybe Int
pid) (\s :: ProcessDetails
s@ProcessDetails' {} Maybe Int
a -> ProcessDetails
s {$sel:pid:ProcessDetails' :: Maybe Int
pid = Maybe Int
a} :: ProcessDetails)
processDetails_terminatedAt :: Lens.Lens' ProcessDetails (Prelude.Maybe Prelude.Text)
processDetails_terminatedAt :: (Maybe Text -> f (Maybe Text))
-> ProcessDetails -> f ProcessDetails
processDetails_terminatedAt = (ProcessDetails -> Maybe Text)
-> (ProcessDetails -> Maybe Text -> ProcessDetails)
-> Lens ProcessDetails ProcessDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessDetails' {Maybe Text
terminatedAt :: Maybe Text
$sel:terminatedAt:ProcessDetails' :: ProcessDetails -> Maybe Text
terminatedAt} -> Maybe Text
terminatedAt) (\s :: ProcessDetails
s@ProcessDetails' {} Maybe Text
a -> ProcessDetails
s {$sel:terminatedAt:ProcessDetails' :: Maybe Text
terminatedAt = Maybe Text
a} :: ProcessDetails)
processDetails_parentPid :: Lens.Lens' ProcessDetails (Prelude.Maybe Prelude.Int)
processDetails_parentPid :: (Maybe Int -> f (Maybe Int)) -> ProcessDetails -> f ProcessDetails
processDetails_parentPid = (ProcessDetails -> Maybe Int)
-> (ProcessDetails -> Maybe Int -> ProcessDetails)
-> Lens ProcessDetails ProcessDetails (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessDetails' {Maybe Int
parentPid :: Maybe Int
$sel:parentPid:ProcessDetails' :: ProcessDetails -> Maybe Int
parentPid} -> Maybe Int
parentPid) (\s :: ProcessDetails
s@ProcessDetails' {} Maybe Int
a -> ProcessDetails
s {$sel:parentPid:ProcessDetails' :: Maybe Int
parentPid = Maybe Int
a} :: ProcessDetails)
processDetails_launchedAt :: Lens.Lens' ProcessDetails (Prelude.Maybe Prelude.Text)
processDetails_launchedAt :: (Maybe Text -> f (Maybe Text))
-> ProcessDetails -> f ProcessDetails
processDetails_launchedAt = (ProcessDetails -> Maybe Text)
-> (ProcessDetails -> Maybe Text -> ProcessDetails)
-> Lens ProcessDetails ProcessDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessDetails' {Maybe Text
launchedAt :: Maybe Text
$sel:launchedAt:ProcessDetails' :: ProcessDetails -> Maybe Text
launchedAt} -> Maybe Text
launchedAt) (\s :: ProcessDetails
s@ProcessDetails' {} Maybe Text
a -> ProcessDetails
s {$sel:launchedAt:ProcessDetails' :: Maybe Text
launchedAt = Maybe Text
a} :: ProcessDetails)
instance Core.FromJSON ProcessDetails where
parseJSON :: Value -> Parser ProcessDetails
parseJSON =
String
-> (Object -> Parser ProcessDetails)
-> Value
-> Parser ProcessDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProcessDetails"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ProcessDetails
ProcessDetails'
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ProcessDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ProcessDetails)
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
"Path")
Parser
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ProcessDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Text -> Maybe Int -> Maybe Text -> ProcessDetails)
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")
Parser
(Maybe Int
-> Maybe Text -> Maybe Int -> Maybe Text -> ProcessDetails)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Int -> Maybe Text -> ProcessDetails)
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
"Pid")
Parser (Maybe Text -> Maybe Int -> Maybe Text -> ProcessDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> ProcessDetails)
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
"TerminatedAt")
Parser (Maybe Int -> Maybe Text -> ProcessDetails)
-> Parser (Maybe Int) -> Parser (Maybe Text -> ProcessDetails)
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
"ParentPid")
Parser (Maybe Text -> ProcessDetails)
-> Parser (Maybe Text) -> Parser ProcessDetails
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
"LaunchedAt")
)
instance Prelude.Hashable ProcessDetails
instance Prelude.NFData ProcessDetails
instance Core.ToJSON ProcessDetails where
toJSON :: ProcessDetails -> Value
toJSON ProcessDetails' {Maybe Int
Maybe Text
launchedAt :: Maybe Text
parentPid :: Maybe Int
terminatedAt :: Maybe Text
pid :: Maybe Int
name :: Maybe Text
path :: Maybe Text
$sel:launchedAt:ProcessDetails' :: ProcessDetails -> Maybe Text
$sel:parentPid:ProcessDetails' :: ProcessDetails -> Maybe Int
$sel:terminatedAt:ProcessDetails' :: ProcessDetails -> Maybe Text
$sel:pid:ProcessDetails' :: ProcessDetails -> Maybe Int
$sel:name:ProcessDetails' :: ProcessDetails -> Maybe Text
$sel:path:ProcessDetails' :: ProcessDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Path" 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
path,
(Text
"Name" 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
name,
(Text
"Pid" 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
pid,
(Text
"TerminatedAt" 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
terminatedAt,
(Text
"ParentPid" 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
parentPid,
(Text
"LaunchedAt" 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
launchedAt
]
)