{-# 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.Lens as Lens
import Amazonka.MacieV2.Types.Occurrences
import qualified Amazonka.Prelude as Prelude
data DefaultDetection = DefaultDetection'
{
DefaultDetection -> Maybe Occurrences
occurrences :: Prelude.Maybe Occurrences,
DefaultDetection -> Maybe Integer
count :: Prelude.Maybe Prelude.Integer,
DefaultDetection -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (DefaultDetection -> DefaultDetection -> Bool
(DefaultDetection -> DefaultDetection -> Bool)
-> (DefaultDetection -> DefaultDetection -> Bool)
-> Eq DefaultDetection
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]
(Int -> ReadS DefaultDetection)
-> ReadS [DefaultDetection]
-> ReadPrec DefaultDetection
-> ReadPrec [DefaultDetection]
-> Read 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
(Int -> DefaultDetection -> ShowS)
-> (DefaultDetection -> String)
-> ([DefaultDetection] -> ShowS)
-> Show DefaultDetection
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. DefaultDetection -> Rep DefaultDetection x)
-> (forall x. Rep DefaultDetection x -> DefaultDetection)
-> Generic DefaultDetection
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' :: Maybe Occurrences
-> Maybe Integer -> Maybe Text -> DefaultDetection
DefaultDetection'
{ $sel:occurrences:DefaultDetection' :: Maybe Occurrences
occurrences = Maybe Occurrences
forall a. Maybe a
Prelude.Nothing,
$sel:count:DefaultDetection' :: Maybe Integer
count = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:type':DefaultDetection' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
defaultDetection_occurrences :: Lens.Lens' DefaultDetection (Prelude.Maybe Occurrences)
defaultDetection_occurrences :: (Maybe Occurrences -> f (Maybe Occurrences))
-> DefaultDetection -> f DefaultDetection
defaultDetection_occurrences = (DefaultDetection -> Maybe Occurrences)
-> (DefaultDetection -> Maybe Occurrences -> DefaultDetection)
-> Lens
DefaultDetection
DefaultDetection
(Maybe Occurrences)
(Maybe 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_count :: Lens.Lens' DefaultDetection (Prelude.Maybe Prelude.Integer)
defaultDetection_count :: (Maybe Integer -> f (Maybe Integer))
-> DefaultDetection -> f DefaultDetection
defaultDetection_count = (DefaultDetection -> Maybe Integer)
-> (DefaultDetection -> Maybe Integer -> DefaultDetection)
-> Lens
DefaultDetection DefaultDetection (Maybe Integer) (Maybe Integer)
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_type :: Lens.Lens' DefaultDetection (Prelude.Maybe Prelude.Text)
defaultDetection_type :: (Maybe Text -> f (Maybe Text))
-> DefaultDetection -> f DefaultDetection
defaultDetection_type = (DefaultDetection -> Maybe Text)
-> (DefaultDetection -> Maybe Text -> DefaultDetection)
-> Lens DefaultDetection DefaultDetection (Maybe Text) (Maybe Text)
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 Core.FromJSON DefaultDetection where
parseJSON :: Value -> Parser DefaultDetection
parseJSON =
String
-> (Object -> Parser DefaultDetection)
-> Value
-> Parser DefaultDetection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DefaultDetection"
( \Object
x ->
Maybe Occurrences
-> Maybe Integer -> Maybe Text -> DefaultDetection
DefaultDetection'
(Maybe Occurrences
-> Maybe Integer -> Maybe Text -> DefaultDetection)
-> Parser (Maybe Occurrences)
-> Parser (Maybe Integer -> Maybe Text -> DefaultDetection)
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 Integer -> Maybe Text -> DefaultDetection)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> DefaultDetection)
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 -> DefaultDetection)
-> Parser (Maybe Text) -> Parser DefaultDetection
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
"type")
)
instance Prelude.Hashable DefaultDetection
instance Prelude.NFData DefaultDetection