{-# 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.Lens as Lens
import Amazonka.MacieV2.Types.ApiCallDetails
import Amazonka.MacieV2.Types.FindingActionType
import qualified Amazonka.Prelude as Prelude
data FindingAction = FindingAction'
{
FindingAction -> Maybe ApiCallDetails
apiCallDetails :: Prelude.Maybe ApiCallDetails,
FindingAction -> Maybe FindingActionType
actionType :: Prelude.Maybe FindingActionType
}
deriving (FindingAction -> FindingAction -> Bool
(FindingAction -> FindingAction -> Bool)
-> (FindingAction -> FindingAction -> Bool) -> Eq FindingAction
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]
(Int -> ReadS FindingAction)
-> ReadS [FindingAction]
-> ReadPrec FindingAction
-> ReadPrec [FindingAction]
-> Read 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
(Int -> FindingAction -> ShowS)
-> (FindingAction -> String)
-> ([FindingAction] -> ShowS)
-> Show FindingAction
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. FindingAction -> Rep FindingAction x)
-> (forall x. Rep FindingAction x -> FindingAction)
-> Generic FindingAction
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' :: Maybe ApiCallDetails -> Maybe FindingActionType -> FindingAction
FindingAction'
{ $sel:apiCallDetails:FindingAction' :: Maybe ApiCallDetails
apiCallDetails = Maybe ApiCallDetails
forall a. Maybe a
Prelude.Nothing,
$sel:actionType:FindingAction' :: Maybe FindingActionType
actionType = Maybe FindingActionType
forall a. Maybe a
Prelude.Nothing
}
findingAction_apiCallDetails :: Lens.Lens' FindingAction (Prelude.Maybe ApiCallDetails)
findingAction_apiCallDetails :: (Maybe ApiCallDetails -> f (Maybe ApiCallDetails))
-> FindingAction -> f FindingAction
findingAction_apiCallDetails = (FindingAction -> Maybe ApiCallDetails)
-> (FindingAction -> Maybe ApiCallDetails -> FindingAction)
-> Lens
FindingAction
FindingAction
(Maybe ApiCallDetails)
(Maybe 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)
findingAction_actionType :: Lens.Lens' FindingAction (Prelude.Maybe FindingActionType)
findingAction_actionType :: (Maybe FindingActionType -> f (Maybe FindingActionType))
-> FindingAction -> f FindingAction
findingAction_actionType = (FindingAction -> Maybe FindingActionType)
-> (FindingAction -> Maybe FindingActionType -> FindingAction)
-> Lens
FindingAction
FindingAction
(Maybe FindingActionType)
(Maybe FindingActionType)
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)
instance Core.FromJSON FindingAction where
parseJSON :: Value -> Parser FindingAction
parseJSON =
String
-> (Object -> Parser FindingAction)
-> Value
-> Parser FindingAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FindingAction"
( \Object
x ->
Maybe ApiCallDetails -> Maybe FindingActionType -> FindingAction
FindingAction'
(Maybe ApiCallDetails -> Maybe FindingActionType -> FindingAction)
-> Parser (Maybe ApiCallDetails)
-> Parser (Maybe FindingActionType -> FindingAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ApiCallDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"apiCallDetails")
Parser (Maybe FindingActionType -> FindingAction)
-> Parser (Maybe FindingActionType) -> Parser FindingAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FindingActionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actionType")
)
instance Prelude.Hashable FindingAction
instance Prelude.NFData FindingAction