{-# 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.MacieV2.Types.FindingAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.ApiCallDetails
import Amazonka.MacieV2.Types.FindingActionType
import qualified Amazonka.Prelude as Prelude
data FindingAction = FindingAction'
{
FindingAction -> Maybe FindingActionType
actionType :: Prelude.Maybe FindingActionType,
FindingAction -> Maybe ApiCallDetails
apiCallDetails :: Prelude.Maybe ApiCallDetails
}
deriving (FindingAction -> FindingAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FindingAction -> FindingAction -> Bool
$c/= :: FindingAction -> FindingAction -> Bool
== :: FindingAction -> FindingAction -> Bool
$c== :: FindingAction -> FindingAction -> Bool
Prelude.Eq, ReadPrec [FindingAction]
ReadPrec FindingAction
Int -> ReadS FindingAction
ReadS [FindingAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FindingAction]
$creadListPrec :: ReadPrec [FindingAction]
readPrec :: ReadPrec FindingAction
$creadPrec :: ReadPrec FindingAction
readList :: ReadS [FindingAction]
$creadList :: ReadS [FindingAction]
readsPrec :: Int -> ReadS FindingAction
$creadsPrec :: Int -> ReadS FindingAction
Prelude.Read, Int -> FindingAction -> ShowS
[FindingAction] -> ShowS
FindingAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FindingAction] -> ShowS
$cshowList :: [FindingAction] -> ShowS
show :: FindingAction -> String
$cshow :: FindingAction -> String
showsPrec :: Int -> FindingAction -> ShowS
$cshowsPrec :: Int -> FindingAction -> ShowS
Prelude.Show, forall x. Rep FindingAction x -> FindingAction
forall x. FindingAction -> Rep FindingAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FindingAction x -> FindingAction
$cfrom :: forall x. FindingAction -> Rep FindingAction x
Prelude.Generic)
newFindingAction ::
FindingAction
newFindingAction :: FindingAction
newFindingAction =
FindingAction'
{ $sel:actionType:FindingAction' :: Maybe FindingActionType
actionType = forall a. Maybe a
Prelude.Nothing,
$sel:apiCallDetails:FindingAction' :: Maybe ApiCallDetails
apiCallDetails = forall a. Maybe a
Prelude.Nothing
}
findingAction_actionType :: Lens.Lens' FindingAction (Prelude.Maybe FindingActionType)
findingAction_actionType :: Lens' FindingAction (Maybe FindingActionType)
findingAction_actionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingAction' {Maybe FindingActionType
actionType :: Maybe FindingActionType
$sel:actionType:FindingAction' :: FindingAction -> Maybe FindingActionType
actionType} -> Maybe FindingActionType
actionType) (\s :: FindingAction
s@FindingAction' {} Maybe FindingActionType
a -> FindingAction
s {$sel:actionType:FindingAction' :: Maybe FindingActionType
actionType = Maybe FindingActionType
a} :: FindingAction)
findingAction_apiCallDetails :: Lens.Lens' FindingAction (Prelude.Maybe ApiCallDetails)
findingAction_apiCallDetails :: Lens' FindingAction (Maybe ApiCallDetails)
findingAction_apiCallDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingAction' {Maybe ApiCallDetails
apiCallDetails :: Maybe ApiCallDetails
$sel:apiCallDetails:FindingAction' :: FindingAction -> Maybe ApiCallDetails
apiCallDetails} -> Maybe ApiCallDetails
apiCallDetails) (\s :: FindingAction
s@FindingAction' {} Maybe ApiCallDetails
a -> FindingAction
s {$sel:apiCallDetails:FindingAction' :: Maybe ApiCallDetails
apiCallDetails = Maybe ApiCallDetails
a} :: FindingAction)
instance Data.FromJSON FindingAction where
parseJSON :: Value -> Parser FindingAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FindingAction"
( \Object
x ->
Maybe FindingActionType -> Maybe ApiCallDetails -> FindingAction
FindingAction'
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
"apiCallDetails")
)
instance Prelude.Hashable FindingAction where
hashWithSalt :: Int -> FindingAction -> Int
hashWithSalt Int
_salt FindingAction' {Maybe ApiCallDetails
Maybe FindingActionType
apiCallDetails :: Maybe ApiCallDetails
actionType :: Maybe FindingActionType
$sel:apiCallDetails:FindingAction' :: FindingAction -> Maybe ApiCallDetails
$sel:actionType:FindingAction' :: FindingAction -> Maybe FindingActionType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FindingActionType
actionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApiCallDetails
apiCallDetails
instance Prelude.NFData FindingAction where
rnf :: FindingAction -> ()
rnf FindingAction' {Maybe ApiCallDetails
Maybe FindingActionType
apiCallDetails :: Maybe ApiCallDetails
actionType :: Maybe FindingActionType
$sel:apiCallDetails:FindingAction' :: FindingAction -> Maybe ApiCallDetails
$sel:actionType:FindingAction' :: FindingAction -> Maybe FindingActionType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FindingActionType
actionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApiCallDetails
apiCallDetails