{-# 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.GuardDuty.Types.Action where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GuardDuty.Types.AwsApiCallAction
import Amazonka.GuardDuty.Types.DnsRequestAction
import Amazonka.GuardDuty.Types.KubernetesApiCallAction
import Amazonka.GuardDuty.Types.NetworkConnectionAction
import Amazonka.GuardDuty.Types.PortProbeAction
import qualified Amazonka.Prelude as Prelude
data Action = Action'
{
Action -> Maybe Text
actionType :: Prelude.Maybe Prelude.Text,
Action -> Maybe AwsApiCallAction
awsApiCallAction :: Prelude.Maybe AwsApiCallAction,
Action -> Maybe DnsRequestAction
dnsRequestAction :: Prelude.Maybe DnsRequestAction,
Action -> Maybe KubernetesApiCallAction
kubernetesApiCallAction :: Prelude.Maybe KubernetesApiCallAction,
Action -> Maybe NetworkConnectionAction
networkConnectionAction :: Prelude.Maybe NetworkConnectionAction,
Action -> Maybe PortProbeAction
portProbeAction :: Prelude.Maybe PortProbeAction
}
deriving (Action -> Action -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Action -> Action -> Bool
$c/= :: Action -> Action -> Bool
== :: Action -> Action -> Bool
$c== :: Action -> Action -> Bool
Prelude.Eq, ReadPrec [Action]
ReadPrec Action
Int -> ReadS Action
ReadS [Action]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Action]
$creadListPrec :: ReadPrec [Action]
readPrec :: ReadPrec Action
$creadPrec :: ReadPrec Action
readList :: ReadS [Action]
$creadList :: ReadS [Action]
readsPrec :: Int -> ReadS Action
$creadsPrec :: Int -> ReadS Action
Prelude.Read, Int -> Action -> ShowS
[Action] -> ShowS
Action -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Action] -> ShowS
$cshowList :: [Action] -> ShowS
show :: Action -> String
$cshow :: Action -> String
showsPrec :: Int -> Action -> ShowS
$cshowsPrec :: Int -> Action -> ShowS
Prelude.Show, forall x. Rep Action x -> Action
forall x. Action -> Rep Action x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Action x -> Action
$cfrom :: forall x. Action -> Rep Action x
Prelude.Generic)
newAction ::
Action
newAction :: Action
newAction =
Action'
{ $sel:actionType:Action' :: Maybe Text
actionType = forall a. Maybe a
Prelude.Nothing,
$sel:awsApiCallAction:Action' :: Maybe AwsApiCallAction
awsApiCallAction = forall a. Maybe a
Prelude.Nothing,
$sel:dnsRequestAction:Action' :: Maybe DnsRequestAction
dnsRequestAction = forall a. Maybe a
Prelude.Nothing,
$sel:kubernetesApiCallAction:Action' :: Maybe KubernetesApiCallAction
kubernetesApiCallAction = forall a. Maybe a
Prelude.Nothing,
$sel:networkConnectionAction:Action' :: Maybe NetworkConnectionAction
networkConnectionAction = forall a. Maybe a
Prelude.Nothing,
$sel:portProbeAction:Action' :: Maybe PortProbeAction
portProbeAction = forall a. Maybe a
Prelude.Nothing
}
action_actionType :: Lens.Lens' Action (Prelude.Maybe Prelude.Text)
action_actionType :: Lens' Action (Maybe Text)
action_actionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe Text
actionType :: Maybe Text
$sel:actionType:Action' :: Action -> Maybe Text
actionType} -> Maybe Text
actionType) (\s :: Action
s@Action' {} Maybe Text
a -> Action
s {$sel:actionType:Action' :: Maybe Text
actionType = Maybe Text
a} :: Action)
action_awsApiCallAction :: Lens.Lens' Action (Prelude.Maybe AwsApiCallAction)
action_awsApiCallAction :: Lens' Action (Maybe AwsApiCallAction)
action_awsApiCallAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe AwsApiCallAction
awsApiCallAction :: Maybe AwsApiCallAction
$sel:awsApiCallAction:Action' :: Action -> Maybe AwsApiCallAction
awsApiCallAction} -> Maybe AwsApiCallAction
awsApiCallAction) (\s :: Action
s@Action' {} Maybe AwsApiCallAction
a -> Action
s {$sel:awsApiCallAction:Action' :: Maybe AwsApiCallAction
awsApiCallAction = Maybe AwsApiCallAction
a} :: Action)
action_dnsRequestAction :: Lens.Lens' Action (Prelude.Maybe DnsRequestAction)
action_dnsRequestAction :: Lens' Action (Maybe DnsRequestAction)
action_dnsRequestAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe DnsRequestAction
dnsRequestAction :: Maybe DnsRequestAction
$sel:dnsRequestAction:Action' :: Action -> Maybe DnsRequestAction
dnsRequestAction} -> Maybe DnsRequestAction
dnsRequestAction) (\s :: Action
s@Action' {} Maybe DnsRequestAction
a -> Action
s {$sel:dnsRequestAction:Action' :: Maybe DnsRequestAction
dnsRequestAction = Maybe DnsRequestAction
a} :: Action)
action_kubernetesApiCallAction :: Lens.Lens' Action (Prelude.Maybe KubernetesApiCallAction)
action_kubernetesApiCallAction :: Lens' Action (Maybe KubernetesApiCallAction)
action_kubernetesApiCallAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe KubernetesApiCallAction
kubernetesApiCallAction :: Maybe KubernetesApiCallAction
$sel:kubernetesApiCallAction:Action' :: Action -> Maybe KubernetesApiCallAction
kubernetesApiCallAction} -> Maybe KubernetesApiCallAction
kubernetesApiCallAction) (\s :: Action
s@Action' {} Maybe KubernetesApiCallAction
a -> Action
s {$sel:kubernetesApiCallAction:Action' :: Maybe KubernetesApiCallAction
kubernetesApiCallAction = Maybe KubernetesApiCallAction
a} :: Action)
action_networkConnectionAction :: Lens.Lens' Action (Prelude.Maybe NetworkConnectionAction)
action_networkConnectionAction :: Lens' Action (Maybe NetworkConnectionAction)
action_networkConnectionAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe NetworkConnectionAction
networkConnectionAction :: Maybe NetworkConnectionAction
$sel:networkConnectionAction:Action' :: Action -> Maybe NetworkConnectionAction
networkConnectionAction} -> Maybe NetworkConnectionAction
networkConnectionAction) (\s :: Action
s@Action' {} Maybe NetworkConnectionAction
a -> Action
s {$sel:networkConnectionAction:Action' :: Maybe NetworkConnectionAction
networkConnectionAction = Maybe NetworkConnectionAction
a} :: Action)
action_portProbeAction :: Lens.Lens' Action (Prelude.Maybe PortProbeAction)
action_portProbeAction :: Lens' Action (Maybe PortProbeAction)
action_portProbeAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe PortProbeAction
portProbeAction :: Maybe PortProbeAction
$sel:portProbeAction:Action' :: Action -> Maybe PortProbeAction
portProbeAction} -> Maybe PortProbeAction
portProbeAction) (\s :: Action
s@Action' {} Maybe PortProbeAction
a -> Action
s {$sel:portProbeAction:Action' :: Maybe PortProbeAction
portProbeAction = Maybe PortProbeAction
a} :: Action)
instance Data.FromJSON Action where
parseJSON :: Value -> Parser Action
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Action"
( \Object
x ->
Maybe Text
-> Maybe AwsApiCallAction
-> Maybe DnsRequestAction
-> Maybe KubernetesApiCallAction
-> Maybe NetworkConnectionAction
-> Maybe PortProbeAction
-> Action
Action'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"actionType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"awsApiCallAction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"dnsRequestAction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"kubernetesApiCallAction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"networkConnectionAction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"portProbeAction")
)
instance Prelude.Hashable Action where
hashWithSalt :: Int -> Action -> Int
hashWithSalt Int
_salt Action' {Maybe Text
Maybe DnsRequestAction
Maybe PortProbeAction
Maybe KubernetesApiCallAction
Maybe AwsApiCallAction
Maybe NetworkConnectionAction
portProbeAction :: Maybe PortProbeAction
networkConnectionAction :: Maybe NetworkConnectionAction
kubernetesApiCallAction :: Maybe KubernetesApiCallAction
dnsRequestAction :: Maybe DnsRequestAction
awsApiCallAction :: Maybe AwsApiCallAction
actionType :: Maybe Text
$sel:portProbeAction:Action' :: Action -> Maybe PortProbeAction
$sel:networkConnectionAction:Action' :: Action -> Maybe NetworkConnectionAction
$sel:kubernetesApiCallAction:Action' :: Action -> Maybe KubernetesApiCallAction
$sel:dnsRequestAction:Action' :: Action -> Maybe DnsRequestAction
$sel:awsApiCallAction:Action' :: Action -> Maybe AwsApiCallAction
$sel:actionType:Action' :: Action -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AwsApiCallAction
awsApiCallAction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DnsRequestAction
dnsRequestAction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe KubernetesApiCallAction
kubernetesApiCallAction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkConnectionAction
networkConnectionAction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PortProbeAction
portProbeAction
instance Prelude.NFData Action where
rnf :: Action -> ()
rnf Action' {Maybe Text
Maybe DnsRequestAction
Maybe PortProbeAction
Maybe KubernetesApiCallAction
Maybe AwsApiCallAction
Maybe NetworkConnectionAction
portProbeAction :: Maybe PortProbeAction
networkConnectionAction :: Maybe NetworkConnectionAction
kubernetesApiCallAction :: Maybe KubernetesApiCallAction
dnsRequestAction :: Maybe DnsRequestAction
awsApiCallAction :: Maybe AwsApiCallAction
actionType :: Maybe Text
$sel:portProbeAction:Action' :: Action -> Maybe PortProbeAction
$sel:networkConnectionAction:Action' :: Action -> Maybe NetworkConnectionAction
$sel:kubernetesApiCallAction:Action' :: Action -> Maybe KubernetesApiCallAction
$sel:dnsRequestAction:Action' :: Action -> Maybe DnsRequestAction
$sel:awsApiCallAction:Action' :: Action -> Maybe AwsApiCallAction
$sel:actionType:Action' :: Action -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AwsApiCallAction
awsApiCallAction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DnsRequestAction
dnsRequestAction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe KubernetesApiCallAction
kubernetesApiCallAction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkConnectionAction
networkConnectionAction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PortProbeAction
portProbeAction