{-# 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.CustomDetection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.Occurrences
import qualified Amazonka.Prelude as Prelude
data CustomDetection = CustomDetection'
{
CustomDetection -> Maybe Occurrences
occurrences :: Prelude.Maybe Occurrences,
CustomDetection -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CustomDetection -> Maybe Integer
count :: Prelude.Maybe Prelude.Integer,
CustomDetection -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (CustomDetection -> CustomDetection -> Bool
(CustomDetection -> CustomDetection -> Bool)
-> (CustomDetection -> CustomDetection -> Bool)
-> Eq CustomDetection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomDetection -> CustomDetection -> Bool
$c/= :: CustomDetection -> CustomDetection -> Bool
== :: CustomDetection -> CustomDetection -> Bool
$c== :: CustomDetection -> CustomDetection -> Bool
Prelude.Eq, ReadPrec [CustomDetection]
ReadPrec CustomDetection
Int -> ReadS CustomDetection
ReadS [CustomDetection]
(Int -> ReadS CustomDetection)
-> ReadS [CustomDetection]
-> ReadPrec CustomDetection
-> ReadPrec [CustomDetection]
-> Read CustomDetection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomDetection]
$creadListPrec :: ReadPrec [CustomDetection]
readPrec :: ReadPrec CustomDetection
$creadPrec :: ReadPrec CustomDetection
readList :: ReadS [CustomDetection]
$creadList :: ReadS [CustomDetection]
readsPrec :: Int -> ReadS CustomDetection
$creadsPrec :: Int -> ReadS CustomDetection
Prelude.Read, Int -> CustomDetection -> ShowS
[CustomDetection] -> ShowS
CustomDetection -> String
(Int -> CustomDetection -> ShowS)
-> (CustomDetection -> String)
-> ([CustomDetection] -> ShowS)
-> Show CustomDetection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomDetection] -> ShowS
$cshowList :: [CustomDetection] -> ShowS
show :: CustomDetection -> String
$cshow :: CustomDetection -> String
showsPrec :: Int -> CustomDetection -> ShowS
$cshowsPrec :: Int -> CustomDetection -> ShowS
Prelude.Show, (forall x. CustomDetection -> Rep CustomDetection x)
-> (forall x. Rep CustomDetection x -> CustomDetection)
-> Generic CustomDetection
forall x. Rep CustomDetection x -> CustomDetection
forall x. CustomDetection -> Rep CustomDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomDetection x -> CustomDetection
$cfrom :: forall x. CustomDetection -> Rep CustomDetection x
Prelude.Generic)
newCustomDetection ::
CustomDetection
newCustomDetection :: CustomDetection
newCustomDetection =
CustomDetection' :: Maybe Occurrences
-> Maybe Text -> Maybe Integer -> Maybe Text -> CustomDetection
CustomDetection'
{ $sel:occurrences:CustomDetection' :: Maybe Occurrences
occurrences = Maybe Occurrences
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CustomDetection' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:count:CustomDetection' :: Maybe Integer
count = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:name:CustomDetection' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
customDetection_occurrences :: Lens.Lens' CustomDetection (Prelude.Maybe Occurrences)
customDetection_occurrences :: (Maybe Occurrences -> f (Maybe Occurrences))
-> CustomDetection -> f CustomDetection
customDetection_occurrences = (CustomDetection -> Maybe Occurrences)
-> (CustomDetection -> Maybe Occurrences -> CustomDetection)
-> Lens
CustomDetection
CustomDetection
(Maybe Occurrences)
(Maybe Occurrences)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDetection' {Maybe Occurrences
occurrences :: Maybe Occurrences
$sel:occurrences:CustomDetection' :: CustomDetection -> Maybe Occurrences
occurrences} -> Maybe Occurrences
occurrences) (\s :: CustomDetection
s@CustomDetection' {} Maybe Occurrences
a -> CustomDetection
s {$sel:occurrences:CustomDetection' :: Maybe Occurrences
occurrences = Maybe Occurrences
a} :: CustomDetection)
customDetection_arn :: Lens.Lens' CustomDetection (Prelude.Maybe Prelude.Text)
customDetection_arn :: (Maybe Text -> f (Maybe Text))
-> CustomDetection -> f CustomDetection
customDetection_arn = (CustomDetection -> Maybe Text)
-> (CustomDetection -> Maybe Text -> CustomDetection)
-> Lens CustomDetection CustomDetection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDetection' {Maybe Text
arn :: Maybe Text
$sel:arn:CustomDetection' :: CustomDetection -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CustomDetection
s@CustomDetection' {} Maybe Text
a -> CustomDetection
s {$sel:arn:CustomDetection' :: Maybe Text
arn = Maybe Text
a} :: CustomDetection)
customDetection_count :: Lens.Lens' CustomDetection (Prelude.Maybe Prelude.Integer)
customDetection_count :: (Maybe Integer -> f (Maybe Integer))
-> CustomDetection -> f CustomDetection
customDetection_count = (CustomDetection -> Maybe Integer)
-> (CustomDetection -> Maybe Integer -> CustomDetection)
-> Lens
CustomDetection CustomDetection (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDetection' {Maybe Integer
count :: Maybe Integer
$sel:count:CustomDetection' :: CustomDetection -> Maybe Integer
count} -> Maybe Integer
count) (\s :: CustomDetection
s@CustomDetection' {} Maybe Integer
a -> CustomDetection
s {$sel:count:CustomDetection' :: Maybe Integer
count = Maybe Integer
a} :: CustomDetection)
customDetection_name :: Lens.Lens' CustomDetection (Prelude.Maybe Prelude.Text)
customDetection_name :: (Maybe Text -> f (Maybe Text))
-> CustomDetection -> f CustomDetection
customDetection_name = (CustomDetection -> Maybe Text)
-> (CustomDetection -> Maybe Text -> CustomDetection)
-> Lens CustomDetection CustomDetection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDetection' {Maybe Text
name :: Maybe Text
$sel:name:CustomDetection' :: CustomDetection -> Maybe Text
name} -> Maybe Text
name) (\s :: CustomDetection
s@CustomDetection' {} Maybe Text
a -> CustomDetection
s {$sel:name:CustomDetection' :: Maybe Text
name = Maybe Text
a} :: CustomDetection)
instance Core.FromJSON CustomDetection where
parseJSON :: Value -> Parser CustomDetection
parseJSON =
String
-> (Object -> Parser CustomDetection)
-> Value
-> Parser CustomDetection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CustomDetection"
( \Object
x ->
Maybe Occurrences
-> Maybe Text -> Maybe Integer -> Maybe Text -> CustomDetection
CustomDetection'
(Maybe Occurrences
-> Maybe Text -> Maybe Integer -> Maybe Text -> CustomDetection)
-> Parser (Maybe Occurrences)
-> Parser
(Maybe Text -> Maybe Integer -> Maybe Text -> CustomDetection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Occurrences)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"occurrences")
Parser
(Maybe Text -> Maybe Integer -> Maybe Text -> CustomDetection)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> Maybe Text -> CustomDetection)
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
"arn")
Parser (Maybe Integer -> Maybe Text -> CustomDetection)
-> Parser (Maybe Integer) -> Parser (Maybe Text -> CustomDetection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"count")
Parser (Maybe Text -> CustomDetection)
-> Parser (Maybe Text) -> Parser CustomDetection
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")
)
instance Prelude.Hashable CustomDetection
instance Prelude.NFData CustomDetection