{-# 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.Detection 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.DataIdentifierType
import qualified Amazonka.Prelude as Prelude
data Detection = Detection'
{
Detection -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Detection -> Maybe Integer
count :: Prelude.Maybe Prelude.Integer,
Detection -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Detection -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Detection -> Maybe Bool
suppressed :: Prelude.Maybe Prelude.Bool,
Detection -> Maybe DataIdentifierType
type' :: Prelude.Maybe DataIdentifierType
}
deriving (Detection -> Detection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Detection -> Detection -> Bool
$c/= :: Detection -> Detection -> Bool
== :: Detection -> Detection -> Bool
$c== :: Detection -> Detection -> Bool
Prelude.Eq, ReadPrec [Detection]
ReadPrec Detection
Int -> ReadS Detection
ReadS [Detection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Detection]
$creadListPrec :: ReadPrec [Detection]
readPrec :: ReadPrec Detection
$creadPrec :: ReadPrec Detection
readList :: ReadS [Detection]
$creadList :: ReadS [Detection]
readsPrec :: Int -> ReadS Detection
$creadsPrec :: Int -> ReadS Detection
Prelude.Read, Int -> Detection -> ShowS
[Detection] -> ShowS
Detection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Detection] -> ShowS
$cshowList :: [Detection] -> ShowS
show :: Detection -> String
$cshow :: Detection -> String
showsPrec :: Int -> Detection -> ShowS
$cshowsPrec :: Int -> Detection -> ShowS
Prelude.Show, forall x. Rep Detection x -> Detection
forall x. Detection -> Rep Detection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Detection x -> Detection
$cfrom :: forall x. Detection -> Rep Detection x
Prelude.Generic)
newDetection ::
Detection
newDetection :: Detection
newDetection =
Detection'
{ $sel:arn:Detection' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:count:Detection' :: Maybe Integer
count = forall a. Maybe a
Prelude.Nothing,
$sel:id:Detection' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:name:Detection' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:suppressed:Detection' :: Maybe Bool
suppressed = forall a. Maybe a
Prelude.Nothing,
$sel:type':Detection' :: Maybe DataIdentifierType
type' = forall a. Maybe a
Prelude.Nothing
}
detection_arn :: Lens.Lens' Detection (Prelude.Maybe Prelude.Text)
detection_arn :: Lens' Detection (Maybe Text)
detection_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Detection' {Maybe Text
arn :: Maybe Text
$sel:arn:Detection' :: Detection -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Detection
s@Detection' {} Maybe Text
a -> Detection
s {$sel:arn:Detection' :: Maybe Text
arn = Maybe Text
a} :: Detection)
detection_count :: Lens.Lens' Detection (Prelude.Maybe Prelude.Integer)
detection_count :: Lens' Detection (Maybe Integer)
detection_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Detection' {Maybe Integer
count :: Maybe Integer
$sel:count:Detection' :: Detection -> Maybe Integer
count} -> Maybe Integer
count) (\s :: Detection
s@Detection' {} Maybe Integer
a -> Detection
s {$sel:count:Detection' :: Maybe Integer
count = Maybe Integer
a} :: Detection)
detection_id :: Lens.Lens' Detection (Prelude.Maybe Prelude.Text)
detection_id :: Lens' Detection (Maybe Text)
detection_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Detection' {Maybe Text
id :: Maybe Text
$sel:id:Detection' :: Detection -> Maybe Text
id} -> Maybe Text
id) (\s :: Detection
s@Detection' {} Maybe Text
a -> Detection
s {$sel:id:Detection' :: Maybe Text
id = Maybe Text
a} :: Detection)
detection_name :: Lens.Lens' Detection (Prelude.Maybe Prelude.Text)
detection_name :: Lens' Detection (Maybe Text)
detection_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Detection' {Maybe Text
name :: Maybe Text
$sel:name:Detection' :: Detection -> Maybe Text
name} -> Maybe Text
name) (\s :: Detection
s@Detection' {} Maybe Text
a -> Detection
s {$sel:name:Detection' :: Maybe Text
name = Maybe Text
a} :: Detection)
detection_suppressed :: Lens.Lens' Detection (Prelude.Maybe Prelude.Bool)
detection_suppressed :: Lens' Detection (Maybe Bool)
detection_suppressed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Detection' {Maybe Bool
suppressed :: Maybe Bool
$sel:suppressed:Detection' :: Detection -> Maybe Bool
suppressed} -> Maybe Bool
suppressed) (\s :: Detection
s@Detection' {} Maybe Bool
a -> Detection
s {$sel:suppressed:Detection' :: Maybe Bool
suppressed = Maybe Bool
a} :: Detection)
detection_type :: Lens.Lens' Detection (Prelude.Maybe DataIdentifierType)
detection_type :: Lens' Detection (Maybe DataIdentifierType)
detection_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Detection' {Maybe DataIdentifierType
type' :: Maybe DataIdentifierType
$sel:type':Detection' :: Detection -> Maybe DataIdentifierType
type'} -> Maybe DataIdentifierType
type') (\s :: Detection
s@Detection' {} Maybe DataIdentifierType
a -> Detection
s {$sel:type':Detection' :: Maybe DataIdentifierType
type' = Maybe DataIdentifierType
a} :: Detection)
instance Data.FromJSON Detection where
parseJSON :: Value -> Parser Detection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Detection"
( \Object
x ->
Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe DataIdentifierType
-> Detection
Detection'
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
"id")
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
"suppressed")
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
"type")
)
instance Prelude.Hashable Detection where
hashWithSalt :: Int -> Detection -> Int
hashWithSalt Int
_salt Detection' {Maybe Bool
Maybe Integer
Maybe Text
Maybe DataIdentifierType
type' :: Maybe DataIdentifierType
suppressed :: Maybe Bool
name :: Maybe Text
id :: Maybe Text
count :: Maybe Integer
arn :: Maybe Text
$sel:type':Detection' :: Detection -> Maybe DataIdentifierType
$sel:suppressed:Detection' :: Detection -> Maybe Bool
$sel:name:Detection' :: Detection -> Maybe Text
$sel:id:Detection' :: Detection -> Maybe Text
$sel:count:Detection' :: Detection -> Maybe Integer
$sel:arn:Detection' :: Detection -> 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
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
suppressed
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataIdentifierType
type'
instance Prelude.NFData Detection where
rnf :: Detection -> ()
rnf Detection' {Maybe Bool
Maybe Integer
Maybe Text
Maybe DataIdentifierType
type' :: Maybe DataIdentifierType
suppressed :: Maybe Bool
name :: Maybe Text
id :: Maybe Text
count :: Maybe Integer
arn :: Maybe Text
$sel:type':Detection' :: Detection -> Maybe DataIdentifierType
$sel:suppressed:Detection' :: Detection -> Maybe Bool
$sel:name:Detection' :: Detection -> Maybe Text
$sel:id:Detection' :: Detection -> Maybe Text
$sel:count:Detection' :: Detection -> Maybe Integer
$sel:arn:Detection' :: Detection -> 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
id
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 Bool
suppressed
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataIdentifierType
type'