{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.Occurrences
import qualified Amazonka.Prelude as Prelude
data CustomDetection = CustomDetection'
{
CustomDetection -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CustomDetection -> Maybe Integer
count :: Prelude.Maybe Prelude.Integer,
CustomDetection -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CustomDetection -> Maybe Occurrences
occurrences :: Prelude.Maybe Occurrences
}
deriving (CustomDetection -> CustomDetection -> Bool
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]
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
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. 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'
{ $sel:arn:CustomDetection' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:count:CustomDetection' :: Maybe Integer
count = forall a. Maybe a
Prelude.Nothing,
$sel:name:CustomDetection' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:occurrences:CustomDetection' :: Maybe Occurrences
occurrences = forall a. Maybe a
Prelude.Nothing
}
customDetection_arn :: Lens.Lens' CustomDetection (Prelude.Maybe Prelude.Text)
customDetection_arn :: Lens' CustomDetection (Maybe Text)
customDetection_arn = 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 :: Lens' CustomDetection (Maybe Integer)
customDetection_count = 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 :: Lens' CustomDetection (Maybe Text)
customDetection_name = 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)
customDetection_occurrences :: Lens.Lens' CustomDetection (Prelude.Maybe Occurrences)
customDetection_occurrences :: Lens' CustomDetection (Maybe Occurrences)
customDetection_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)
instance Data.FromJSON CustomDetection where
parseJSON :: Value -> Parser CustomDetection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CustomDetection"
( \Object
x ->
Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Occurrences
-> CustomDetection
CustomDetection'
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
"arn")
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
"count")
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
"name")
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
"occurrences")
)
instance Prelude.Hashable CustomDetection where
hashWithSalt :: Int -> CustomDetection -> Int
hashWithSalt Int
_salt CustomDetection' {Maybe Integer
Maybe Text
Maybe Occurrences
occurrences :: Maybe Occurrences
name :: Maybe Text
count :: Maybe Integer
arn :: Maybe Text
$sel:occurrences:CustomDetection' :: CustomDetection -> Maybe Occurrences
$sel:name:CustomDetection' :: CustomDetection -> Maybe Text
$sel:count:CustomDetection' :: CustomDetection -> Maybe Integer
$sel:arn:CustomDetection' :: CustomDetection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
count
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Occurrences
occurrences
instance Prelude.NFData CustomDetection where
rnf :: CustomDetection -> ()
rnf CustomDetection' {Maybe Integer
Maybe Text
Maybe Occurrences
occurrences :: Maybe Occurrences
name :: Maybe Text
count :: Maybe Integer
arn :: Maybe Text
$sel:occurrences:CustomDetection' :: CustomDetection -> Maybe Occurrences
$sel:name:CustomDetection' :: CustomDetection -> Maybe Text
$sel:count:CustomDetection' :: CustomDetection -> Maybe Integer
$sel:arn:CustomDetection' :: CustomDetection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
count
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Occurrences
occurrences