{-# 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.SensitiveDataItem 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.DefaultDetection
import Amazonka.MacieV2.Types.SensitiveDataItemCategory
import qualified Amazonka.Prelude as Prelude
data SensitiveDataItem = SensitiveDataItem'
{
SensitiveDataItem -> Maybe SensitiveDataItemCategory
category :: Prelude.Maybe SensitiveDataItemCategory,
SensitiveDataItem -> Maybe [DefaultDetection]
detections :: Prelude.Maybe [DefaultDetection],
SensitiveDataItem -> Maybe Integer
totalCount :: Prelude.Maybe Prelude.Integer
}
deriving (SensitiveDataItem -> SensitiveDataItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SensitiveDataItem -> SensitiveDataItem -> Bool
$c/= :: SensitiveDataItem -> SensitiveDataItem -> Bool
== :: SensitiveDataItem -> SensitiveDataItem -> Bool
$c== :: SensitiveDataItem -> SensitiveDataItem -> Bool
Prelude.Eq, ReadPrec [SensitiveDataItem]
ReadPrec SensitiveDataItem
Int -> ReadS SensitiveDataItem
ReadS [SensitiveDataItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SensitiveDataItem]
$creadListPrec :: ReadPrec [SensitiveDataItem]
readPrec :: ReadPrec SensitiveDataItem
$creadPrec :: ReadPrec SensitiveDataItem
readList :: ReadS [SensitiveDataItem]
$creadList :: ReadS [SensitiveDataItem]
readsPrec :: Int -> ReadS SensitiveDataItem
$creadsPrec :: Int -> ReadS SensitiveDataItem
Prelude.Read, Int -> SensitiveDataItem -> ShowS
[SensitiveDataItem] -> ShowS
SensitiveDataItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SensitiveDataItem] -> ShowS
$cshowList :: [SensitiveDataItem] -> ShowS
show :: SensitiveDataItem -> String
$cshow :: SensitiveDataItem -> String
showsPrec :: Int -> SensitiveDataItem -> ShowS
$cshowsPrec :: Int -> SensitiveDataItem -> ShowS
Prelude.Show, forall x. Rep SensitiveDataItem x -> SensitiveDataItem
forall x. SensitiveDataItem -> Rep SensitiveDataItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SensitiveDataItem x -> SensitiveDataItem
$cfrom :: forall x. SensitiveDataItem -> Rep SensitiveDataItem x
Prelude.Generic)
newSensitiveDataItem ::
SensitiveDataItem
newSensitiveDataItem :: SensitiveDataItem
newSensitiveDataItem =
SensitiveDataItem'
{ $sel:category:SensitiveDataItem' :: Maybe SensitiveDataItemCategory
category = forall a. Maybe a
Prelude.Nothing,
$sel:detections:SensitiveDataItem' :: Maybe [DefaultDetection]
detections = forall a. Maybe a
Prelude.Nothing,
$sel:totalCount:SensitiveDataItem' :: Maybe Integer
totalCount = forall a. Maybe a
Prelude.Nothing
}
sensitiveDataItem_category :: Lens.Lens' SensitiveDataItem (Prelude.Maybe SensitiveDataItemCategory)
sensitiveDataItem_category :: Lens' SensitiveDataItem (Maybe SensitiveDataItemCategory)
sensitiveDataItem_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitiveDataItem' {Maybe SensitiveDataItemCategory
category :: Maybe SensitiveDataItemCategory
$sel:category:SensitiveDataItem' :: SensitiveDataItem -> Maybe SensitiveDataItemCategory
category} -> Maybe SensitiveDataItemCategory
category) (\s :: SensitiveDataItem
s@SensitiveDataItem' {} Maybe SensitiveDataItemCategory
a -> SensitiveDataItem
s {$sel:category:SensitiveDataItem' :: Maybe SensitiveDataItemCategory
category = Maybe SensitiveDataItemCategory
a} :: SensitiveDataItem)
sensitiveDataItem_detections :: Lens.Lens' SensitiveDataItem (Prelude.Maybe [DefaultDetection])
sensitiveDataItem_detections :: Lens' SensitiveDataItem (Maybe [DefaultDetection])
sensitiveDataItem_detections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitiveDataItem' {Maybe [DefaultDetection]
detections :: Maybe [DefaultDetection]
$sel:detections:SensitiveDataItem' :: SensitiveDataItem -> Maybe [DefaultDetection]
detections} -> Maybe [DefaultDetection]
detections) (\s :: SensitiveDataItem
s@SensitiveDataItem' {} Maybe [DefaultDetection]
a -> SensitiveDataItem
s {$sel:detections:SensitiveDataItem' :: Maybe [DefaultDetection]
detections = Maybe [DefaultDetection]
a} :: SensitiveDataItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sensitiveDataItem_totalCount :: Lens.Lens' SensitiveDataItem (Prelude.Maybe Prelude.Integer)
sensitiveDataItem_totalCount :: Lens' SensitiveDataItem (Maybe Integer)
sensitiveDataItem_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitiveDataItem' {Maybe Integer
totalCount :: Maybe Integer
$sel:totalCount:SensitiveDataItem' :: SensitiveDataItem -> Maybe Integer
totalCount} -> Maybe Integer
totalCount) (\s :: SensitiveDataItem
s@SensitiveDataItem' {} Maybe Integer
a -> SensitiveDataItem
s {$sel:totalCount:SensitiveDataItem' :: Maybe Integer
totalCount = Maybe Integer
a} :: SensitiveDataItem)
instance Data.FromJSON SensitiveDataItem where
parseJSON :: Value -> Parser SensitiveDataItem
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SensitiveDataItem"
( \Object
x ->
Maybe SensitiveDataItemCategory
-> Maybe [DefaultDetection] -> Maybe Integer -> SensitiveDataItem
SensitiveDataItem'
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
"category")
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
"detections" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"totalCount")
)
instance Prelude.Hashable SensitiveDataItem where
hashWithSalt :: Int -> SensitiveDataItem -> Int
hashWithSalt Int
_salt SensitiveDataItem' {Maybe Integer
Maybe [DefaultDetection]
Maybe SensitiveDataItemCategory
totalCount :: Maybe Integer
detections :: Maybe [DefaultDetection]
category :: Maybe SensitiveDataItemCategory
$sel:totalCount:SensitiveDataItem' :: SensitiveDataItem -> Maybe Integer
$sel:detections:SensitiveDataItem' :: SensitiveDataItem -> Maybe [DefaultDetection]
$sel:category:SensitiveDataItem' :: SensitiveDataItem -> Maybe SensitiveDataItemCategory
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SensitiveDataItemCategory
category
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DefaultDetection]
detections
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalCount
instance Prelude.NFData SensitiveDataItem where
rnf :: SensitiveDataItem -> ()
rnf SensitiveDataItem' {Maybe Integer
Maybe [DefaultDetection]
Maybe SensitiveDataItemCategory
totalCount :: Maybe Integer
detections :: Maybe [DefaultDetection]
category :: Maybe SensitiveDataItemCategory
$sel:totalCount:SensitiveDataItem' :: SensitiveDataItem -> Maybe Integer
$sel:detections:SensitiveDataItem' :: SensitiveDataItem -> Maybe [DefaultDetection]
$sel:category:SensitiveDataItem' :: SensitiveDataItem -> Maybe SensitiveDataItemCategory
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SensitiveDataItemCategory
category
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DefaultDetection]
detections
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalCount