{-# 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.SecurityHub.Types.ClassificationResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.ClassificationStatus
import Amazonka.SecurityHub.Types.CustomDataIdentifiersResult
import Amazonka.SecurityHub.Types.SensitiveDataResult
data ClassificationResult = ClassificationResult'
{
ClassificationResult -> Maybe ClassificationStatus
status :: Prelude.Maybe ClassificationStatus,
ClassificationResult -> Maybe [SensitiveDataResult]
sensitiveData :: Prelude.Maybe [SensitiveDataResult],
ClassificationResult -> Maybe Text
mimeType :: Prelude.Maybe Prelude.Text,
ClassificationResult -> Maybe Integer
sizeClassified :: Prelude.Maybe Prelude.Integer,
ClassificationResult -> Maybe Bool
additionalOccurrences :: Prelude.Maybe Prelude.Bool,
ClassificationResult -> Maybe CustomDataIdentifiersResult
customDataIdentifiers :: Prelude.Maybe CustomDataIdentifiersResult
}
deriving (ClassificationResult -> ClassificationResult -> Bool
(ClassificationResult -> ClassificationResult -> Bool)
-> (ClassificationResult -> ClassificationResult -> Bool)
-> Eq ClassificationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassificationResult -> ClassificationResult -> Bool
$c/= :: ClassificationResult -> ClassificationResult -> Bool
== :: ClassificationResult -> ClassificationResult -> Bool
$c== :: ClassificationResult -> ClassificationResult -> Bool
Prelude.Eq, ReadPrec [ClassificationResult]
ReadPrec ClassificationResult
Int -> ReadS ClassificationResult
ReadS [ClassificationResult]
(Int -> ReadS ClassificationResult)
-> ReadS [ClassificationResult]
-> ReadPrec ClassificationResult
-> ReadPrec [ClassificationResult]
-> Read ClassificationResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClassificationResult]
$creadListPrec :: ReadPrec [ClassificationResult]
readPrec :: ReadPrec ClassificationResult
$creadPrec :: ReadPrec ClassificationResult
readList :: ReadS [ClassificationResult]
$creadList :: ReadS [ClassificationResult]
readsPrec :: Int -> ReadS ClassificationResult
$creadsPrec :: Int -> ReadS ClassificationResult
Prelude.Read, Int -> ClassificationResult -> ShowS
[ClassificationResult] -> ShowS
ClassificationResult -> String
(Int -> ClassificationResult -> ShowS)
-> (ClassificationResult -> String)
-> ([ClassificationResult] -> ShowS)
-> Show ClassificationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassificationResult] -> ShowS
$cshowList :: [ClassificationResult] -> ShowS
show :: ClassificationResult -> String
$cshow :: ClassificationResult -> String
showsPrec :: Int -> ClassificationResult -> ShowS
$cshowsPrec :: Int -> ClassificationResult -> ShowS
Prelude.Show, (forall x. ClassificationResult -> Rep ClassificationResult x)
-> (forall x. Rep ClassificationResult x -> ClassificationResult)
-> Generic ClassificationResult
forall x. Rep ClassificationResult x -> ClassificationResult
forall x. ClassificationResult -> Rep ClassificationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClassificationResult x -> ClassificationResult
$cfrom :: forall x. ClassificationResult -> Rep ClassificationResult x
Prelude.Generic)
newClassificationResult ::
ClassificationResult
newClassificationResult :: ClassificationResult
newClassificationResult =
ClassificationResult' :: Maybe ClassificationStatus
-> Maybe [SensitiveDataResult]
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult
ClassificationResult'
{ $sel:status:ClassificationResult' :: Maybe ClassificationStatus
status = Maybe ClassificationStatus
forall a. Maybe a
Prelude.Nothing,
$sel:sensitiveData:ClassificationResult' :: Maybe [SensitiveDataResult]
sensitiveData = Maybe [SensitiveDataResult]
forall a. Maybe a
Prelude.Nothing,
$sel:mimeType:ClassificationResult' :: Maybe Text
mimeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sizeClassified:ClassificationResult' :: Maybe Integer
sizeClassified = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:additionalOccurrences:ClassificationResult' :: Maybe Bool
additionalOccurrences = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:customDataIdentifiers:ClassificationResult' :: Maybe CustomDataIdentifiersResult
customDataIdentifiers = Maybe CustomDataIdentifiersResult
forall a. Maybe a
Prelude.Nothing
}
classificationResult_status :: Lens.Lens' ClassificationResult (Prelude.Maybe ClassificationStatus)
classificationResult_status :: (Maybe ClassificationStatus -> f (Maybe ClassificationStatus))
-> ClassificationResult -> f ClassificationResult
classificationResult_status = (ClassificationResult -> Maybe ClassificationStatus)
-> (ClassificationResult
-> Maybe ClassificationStatus -> ClassificationResult)
-> Lens
ClassificationResult
ClassificationResult
(Maybe ClassificationStatus)
(Maybe ClassificationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResult' {Maybe ClassificationStatus
status :: Maybe ClassificationStatus
$sel:status:ClassificationResult' :: ClassificationResult -> Maybe ClassificationStatus
status} -> Maybe ClassificationStatus
status) (\s :: ClassificationResult
s@ClassificationResult' {} Maybe ClassificationStatus
a -> ClassificationResult
s {$sel:status:ClassificationResult' :: Maybe ClassificationStatus
status = Maybe ClassificationStatus
a} :: ClassificationResult)
classificationResult_sensitiveData :: Lens.Lens' ClassificationResult (Prelude.Maybe [SensitiveDataResult])
classificationResult_sensitiveData :: (Maybe [SensitiveDataResult] -> f (Maybe [SensitiveDataResult]))
-> ClassificationResult -> f ClassificationResult
classificationResult_sensitiveData = (ClassificationResult -> Maybe [SensitiveDataResult])
-> (ClassificationResult
-> Maybe [SensitiveDataResult] -> ClassificationResult)
-> Lens
ClassificationResult
ClassificationResult
(Maybe [SensitiveDataResult])
(Maybe [SensitiveDataResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResult' {Maybe [SensitiveDataResult]
sensitiveData :: Maybe [SensitiveDataResult]
$sel:sensitiveData:ClassificationResult' :: ClassificationResult -> Maybe [SensitiveDataResult]
sensitiveData} -> Maybe [SensitiveDataResult]
sensitiveData) (\s :: ClassificationResult
s@ClassificationResult' {} Maybe [SensitiveDataResult]
a -> ClassificationResult
s {$sel:sensitiveData:ClassificationResult' :: Maybe [SensitiveDataResult]
sensitiveData = Maybe [SensitiveDataResult]
a} :: ClassificationResult) ((Maybe [SensitiveDataResult] -> f (Maybe [SensitiveDataResult]))
-> ClassificationResult -> f ClassificationResult)
-> ((Maybe [SensitiveDataResult]
-> f (Maybe [SensitiveDataResult]))
-> Maybe [SensitiveDataResult] -> f (Maybe [SensitiveDataResult]))
-> (Maybe [SensitiveDataResult] -> f (Maybe [SensitiveDataResult]))
-> ClassificationResult
-> f ClassificationResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SensitiveDataResult]
[SensitiveDataResult]
[SensitiveDataResult]
[SensitiveDataResult]
-> Iso
(Maybe [SensitiveDataResult])
(Maybe [SensitiveDataResult])
(Maybe [SensitiveDataResult])
(Maybe [SensitiveDataResult])
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 AnIso
[SensitiveDataResult]
[SensitiveDataResult]
[SensitiveDataResult]
[SensitiveDataResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
classificationResult_mimeType :: Lens.Lens' ClassificationResult (Prelude.Maybe Prelude.Text)
classificationResult_mimeType :: (Maybe Text -> f (Maybe Text))
-> ClassificationResult -> f ClassificationResult
classificationResult_mimeType = (ClassificationResult -> Maybe Text)
-> (ClassificationResult -> Maybe Text -> ClassificationResult)
-> Lens
ClassificationResult ClassificationResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResult' {Maybe Text
mimeType :: Maybe Text
$sel:mimeType:ClassificationResult' :: ClassificationResult -> Maybe Text
mimeType} -> Maybe Text
mimeType) (\s :: ClassificationResult
s@ClassificationResult' {} Maybe Text
a -> ClassificationResult
s {$sel:mimeType:ClassificationResult' :: Maybe Text
mimeType = Maybe Text
a} :: ClassificationResult)
classificationResult_sizeClassified :: Lens.Lens' ClassificationResult (Prelude.Maybe Prelude.Integer)
classificationResult_sizeClassified :: (Maybe Integer -> f (Maybe Integer))
-> ClassificationResult -> f ClassificationResult
classificationResult_sizeClassified = (ClassificationResult -> Maybe Integer)
-> (ClassificationResult -> Maybe Integer -> ClassificationResult)
-> Lens
ClassificationResult
ClassificationResult
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResult' {Maybe Integer
sizeClassified :: Maybe Integer
$sel:sizeClassified:ClassificationResult' :: ClassificationResult -> Maybe Integer
sizeClassified} -> Maybe Integer
sizeClassified) (\s :: ClassificationResult
s@ClassificationResult' {} Maybe Integer
a -> ClassificationResult
s {$sel:sizeClassified:ClassificationResult' :: Maybe Integer
sizeClassified = Maybe Integer
a} :: ClassificationResult)
classificationResult_additionalOccurrences :: Lens.Lens' ClassificationResult (Prelude.Maybe Prelude.Bool)
classificationResult_additionalOccurrences :: (Maybe Bool -> f (Maybe Bool))
-> ClassificationResult -> f ClassificationResult
classificationResult_additionalOccurrences = (ClassificationResult -> Maybe Bool)
-> (ClassificationResult -> Maybe Bool -> ClassificationResult)
-> Lens
ClassificationResult ClassificationResult (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResult' {Maybe Bool
additionalOccurrences :: Maybe Bool
$sel:additionalOccurrences:ClassificationResult' :: ClassificationResult -> Maybe Bool
additionalOccurrences} -> Maybe Bool
additionalOccurrences) (\s :: ClassificationResult
s@ClassificationResult' {} Maybe Bool
a -> ClassificationResult
s {$sel:additionalOccurrences:ClassificationResult' :: Maybe Bool
additionalOccurrences = Maybe Bool
a} :: ClassificationResult)
classificationResult_customDataIdentifiers :: Lens.Lens' ClassificationResult (Prelude.Maybe CustomDataIdentifiersResult)
classificationResult_customDataIdentifiers :: (Maybe CustomDataIdentifiersResult
-> f (Maybe CustomDataIdentifiersResult))
-> ClassificationResult -> f ClassificationResult
classificationResult_customDataIdentifiers = (ClassificationResult -> Maybe CustomDataIdentifiersResult)
-> (ClassificationResult
-> Maybe CustomDataIdentifiersResult -> ClassificationResult)
-> Lens
ClassificationResult
ClassificationResult
(Maybe CustomDataIdentifiersResult)
(Maybe CustomDataIdentifiersResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResult' {Maybe CustomDataIdentifiersResult
customDataIdentifiers :: Maybe CustomDataIdentifiersResult
$sel:customDataIdentifiers:ClassificationResult' :: ClassificationResult -> Maybe CustomDataIdentifiersResult
customDataIdentifiers} -> Maybe CustomDataIdentifiersResult
customDataIdentifiers) (\s :: ClassificationResult
s@ClassificationResult' {} Maybe CustomDataIdentifiersResult
a -> ClassificationResult
s {$sel:customDataIdentifiers:ClassificationResult' :: Maybe CustomDataIdentifiersResult
customDataIdentifiers = Maybe CustomDataIdentifiersResult
a} :: ClassificationResult)
instance Core.FromJSON ClassificationResult where
parseJSON :: Value -> Parser ClassificationResult
parseJSON =
String
-> (Object -> Parser ClassificationResult)
-> Value
-> Parser ClassificationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClassificationResult"
( \Object
x ->
Maybe ClassificationStatus
-> Maybe [SensitiveDataResult]
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult
ClassificationResult'
(Maybe ClassificationStatus
-> Maybe [SensitiveDataResult]
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult)
-> Parser (Maybe ClassificationStatus)
-> Parser
(Maybe [SensitiveDataResult]
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ClassificationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe [SensitiveDataResult]
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult)
-> Parser (Maybe [SensitiveDataResult])
-> Parser
(Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [SensitiveDataResult]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SensitiveData" Parser (Maybe (Maybe [SensitiveDataResult]))
-> Maybe [SensitiveDataResult]
-> Parser (Maybe [SensitiveDataResult])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SensitiveDataResult]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult)
-> Parser (Maybe Text)
-> Parser
(Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult)
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
"MimeType")
Parser
(Maybe Integer
-> Maybe Bool
-> Maybe CustomDataIdentifiersResult
-> ClassificationResult)
-> Parser (Maybe Integer)
-> Parser
(Maybe Bool
-> Maybe CustomDataIdentifiersResult -> ClassificationResult)
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
"SizeClassified")
Parser
(Maybe Bool
-> Maybe CustomDataIdentifiersResult -> ClassificationResult)
-> Parser (Maybe Bool)
-> Parser
(Maybe CustomDataIdentifiersResult -> ClassificationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AdditionalOccurrences")
Parser (Maybe CustomDataIdentifiersResult -> ClassificationResult)
-> Parser (Maybe CustomDataIdentifiersResult)
-> Parser ClassificationResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomDataIdentifiersResult)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomDataIdentifiers")
)
instance Prelude.Hashable ClassificationResult
instance Prelude.NFData ClassificationResult
instance Core.ToJSON ClassificationResult where
toJSON :: ClassificationResult -> Value
toJSON ClassificationResult' {Maybe Bool
Maybe Integer
Maybe [SensitiveDataResult]
Maybe Text
Maybe ClassificationStatus
Maybe CustomDataIdentifiersResult
customDataIdentifiers :: Maybe CustomDataIdentifiersResult
additionalOccurrences :: Maybe Bool
sizeClassified :: Maybe Integer
mimeType :: Maybe Text
sensitiveData :: Maybe [SensitiveDataResult]
status :: Maybe ClassificationStatus
$sel:customDataIdentifiers:ClassificationResult' :: ClassificationResult -> Maybe CustomDataIdentifiersResult
$sel:additionalOccurrences:ClassificationResult' :: ClassificationResult -> Maybe Bool
$sel:sizeClassified:ClassificationResult' :: ClassificationResult -> Maybe Integer
$sel:mimeType:ClassificationResult' :: ClassificationResult -> Maybe Text
$sel:sensitiveData:ClassificationResult' :: ClassificationResult -> Maybe [SensitiveDataResult]
$sel:status:ClassificationResult' :: ClassificationResult -> Maybe ClassificationStatus
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Status" Text -> ClassificationStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ClassificationStatus -> Pair)
-> Maybe ClassificationStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ClassificationStatus
status,
(Text
"SensitiveData" Text -> [SensitiveDataResult] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SensitiveDataResult] -> Pair)
-> Maybe [SensitiveDataResult] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SensitiveDataResult]
sensitiveData,
(Text
"MimeType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
mimeType,
(Text
"SizeClassified" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
sizeClassified,
(Text
"AdditionalOccurrences" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
additionalOccurrences,
(Text
"CustomDataIdentifiers" Text -> CustomDataIdentifiersResult -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CustomDataIdentifiersResult -> Pair)
-> Maybe CustomDataIdentifiersResult -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomDataIdentifiersResult
customDataIdentifiers
]
)