{-# 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.DefaultDetection 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 DefaultDetection = DefaultDetection'
{
DefaultDetection -> Maybe Integer
count :: Prelude.Maybe Prelude.Integer,
DefaultDetection -> Maybe Occurrences
occurrences :: Prelude.Maybe Occurrences,
DefaultDetection -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (DefaultDetection -> DefaultDetection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefaultDetection -> DefaultDetection -> Bool
$c/= :: DefaultDetection -> DefaultDetection -> Bool
== :: DefaultDetection -> DefaultDetection -> Bool
$c== :: DefaultDetection -> DefaultDetection -> Bool
Prelude.Eq, ReadPrec [DefaultDetection]
ReadPrec DefaultDetection
Int -> ReadS DefaultDetection
ReadS [DefaultDetection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DefaultDetection]
$creadListPrec :: ReadPrec [DefaultDetection]
readPrec :: ReadPrec DefaultDetection
$creadPrec :: ReadPrec DefaultDetection
readList :: ReadS [DefaultDetection]
$creadList :: ReadS [DefaultDetection]
readsPrec :: Int -> ReadS DefaultDetection
$creadsPrec :: Int -> ReadS DefaultDetection
Prelude.Read, Int -> DefaultDetection -> ShowS
[DefaultDetection] -> ShowS
DefaultDetection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DefaultDetection] -> ShowS
$cshowList :: [DefaultDetection] -> ShowS
show :: DefaultDetection -> String
$cshow :: DefaultDetection -> String
showsPrec :: Int -> DefaultDetection -> ShowS
$cshowsPrec :: Int -> DefaultDetection -> ShowS
Prelude.Show, forall x. Rep DefaultDetection x -> DefaultDetection
forall x. DefaultDetection -> Rep DefaultDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DefaultDetection x -> DefaultDetection
$cfrom :: forall x. DefaultDetection -> Rep DefaultDetection x
Prelude.Generic)
newDefaultDetection ::
DefaultDetection
newDefaultDetection :: DefaultDetection
newDefaultDetection =
DefaultDetection'
{ $sel:count:DefaultDetection' :: Maybe Integer
count = forall a. Maybe a
Prelude.Nothing,
$sel:occurrences:DefaultDetection' :: Maybe Occurrences
occurrences = forall a. Maybe a
Prelude.Nothing,
$sel:type':DefaultDetection' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
}
defaultDetection_count :: Lens.Lens' DefaultDetection (Prelude.Maybe Prelude.Integer)
defaultDetection_count :: Lens' DefaultDetection (Maybe Integer)
defaultDetection_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultDetection' {Maybe Integer
count :: Maybe Integer
$sel:count:DefaultDetection' :: DefaultDetection -> Maybe Integer
count} -> Maybe Integer
count) (\s :: DefaultDetection
s@DefaultDetection' {} Maybe Integer
a -> DefaultDetection
s {$sel:count:DefaultDetection' :: Maybe Integer
count = Maybe Integer
a} :: DefaultDetection)
defaultDetection_occurrences :: Lens.Lens' DefaultDetection (Prelude.Maybe Occurrences)
defaultDetection_occurrences :: Lens' DefaultDetection (Maybe Occurrences)
defaultDetection_occurrences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultDetection' {Maybe Occurrences
occurrences :: Maybe Occurrences
$sel:occurrences:DefaultDetection' :: DefaultDetection -> Maybe Occurrences
occurrences} -> Maybe Occurrences
occurrences) (\s :: DefaultDetection
s@DefaultDetection' {} Maybe Occurrences
a -> DefaultDetection
s {$sel:occurrences:DefaultDetection' :: Maybe Occurrences
occurrences = Maybe Occurrences
a} :: DefaultDetection)
defaultDetection_type :: Lens.Lens' DefaultDetection (Prelude.Maybe Prelude.Text)
defaultDetection_type :: Lens' DefaultDetection (Maybe Text)
defaultDetection_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultDetection' {Maybe Text
type' :: Maybe Text
$sel:type':DefaultDetection' :: DefaultDetection -> Maybe Text
type'} -> Maybe Text
type') (\s :: DefaultDetection
s@DefaultDetection' {} Maybe Text
a -> DefaultDetection
s {$sel:type':DefaultDetection' :: Maybe Text
type' = Maybe Text
a} :: DefaultDetection)
instance Data.FromJSON DefaultDetection where
parseJSON :: Value -> Parser DefaultDetection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DefaultDetection"
( \Object
x ->
Maybe Integer
-> Maybe Occurrences -> Maybe Text -> DefaultDetection
DefaultDetection'
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
"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
"occurrences")
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 DefaultDetection where
hashWithSalt :: Int -> DefaultDetection -> Int
hashWithSalt Int
_salt DefaultDetection' {Maybe Integer
Maybe Text
Maybe Occurrences
type' :: Maybe Text
occurrences :: Maybe Occurrences
count :: Maybe Integer
$sel:type':DefaultDetection' :: DefaultDetection -> Maybe Text
$sel:occurrences:DefaultDetection' :: DefaultDetection -> Maybe Occurrences
$sel:count:DefaultDetection' :: DefaultDetection -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
count
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Occurrences
occurrences
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
instance Prelude.NFData DefaultDetection where
rnf :: DefaultDetection -> ()
rnf DefaultDetection' {Maybe Integer
Maybe Text
Maybe Occurrences
type' :: Maybe Text
occurrences :: Maybe Occurrences
count :: Maybe Integer
$sel:type':DefaultDetection' :: DefaultDetection -> Maybe Text
$sel:occurrences:DefaultDetection' :: DefaultDetection -> Maybe Occurrences
$sel:count:DefaultDetection' :: DefaultDetection -> Maybe Integer
..} =
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 Occurrences
occurrences
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'