{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MacieV2.Types.ClassificationDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.ClassificationDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.ClassificationResult
import qualified Amazonka.Prelude as Prelude

-- | Provides information about a sensitive data finding, including the
-- classification job that produced the finding.
--
-- /See:/ 'newClassificationDetails' smart constructor.
data ClassificationDetails = ClassificationDetails'
  { -- | The path to the folder or file (in Amazon S3) that contains the
    -- corresponding sensitive data discovery result for the finding. If a
    -- finding applies to a large archive or compressed file, this value is the
    -- path to a folder. Otherwise, this value is the path to a file.
    ClassificationDetails -> Maybe Text
detailedResultsLocation :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the classification job that produced the
    -- finding.
    ClassificationDetails -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the classification job that produced
    -- the finding.
    ClassificationDetails -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
    -- | The status and other details of the finding.
    ClassificationDetails -> Maybe ClassificationResult
result :: Prelude.Maybe ClassificationResult
  }
  deriving (ClassificationDetails -> ClassificationDetails -> Bool
(ClassificationDetails -> ClassificationDetails -> Bool)
-> (ClassificationDetails -> ClassificationDetails -> Bool)
-> Eq ClassificationDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassificationDetails -> ClassificationDetails -> Bool
$c/= :: ClassificationDetails -> ClassificationDetails -> Bool
== :: ClassificationDetails -> ClassificationDetails -> Bool
$c== :: ClassificationDetails -> ClassificationDetails -> Bool
Prelude.Eq, ReadPrec [ClassificationDetails]
ReadPrec ClassificationDetails
Int -> ReadS ClassificationDetails
ReadS [ClassificationDetails]
(Int -> ReadS ClassificationDetails)
-> ReadS [ClassificationDetails]
-> ReadPrec ClassificationDetails
-> ReadPrec [ClassificationDetails]
-> Read ClassificationDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClassificationDetails]
$creadListPrec :: ReadPrec [ClassificationDetails]
readPrec :: ReadPrec ClassificationDetails
$creadPrec :: ReadPrec ClassificationDetails
readList :: ReadS [ClassificationDetails]
$creadList :: ReadS [ClassificationDetails]
readsPrec :: Int -> ReadS ClassificationDetails
$creadsPrec :: Int -> ReadS ClassificationDetails
Prelude.Read, Int -> ClassificationDetails -> ShowS
[ClassificationDetails] -> ShowS
ClassificationDetails -> String
(Int -> ClassificationDetails -> ShowS)
-> (ClassificationDetails -> String)
-> ([ClassificationDetails] -> ShowS)
-> Show ClassificationDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassificationDetails] -> ShowS
$cshowList :: [ClassificationDetails] -> ShowS
show :: ClassificationDetails -> String
$cshow :: ClassificationDetails -> String
showsPrec :: Int -> ClassificationDetails -> ShowS
$cshowsPrec :: Int -> ClassificationDetails -> ShowS
Prelude.Show, (forall x. ClassificationDetails -> Rep ClassificationDetails x)
-> (forall x. Rep ClassificationDetails x -> ClassificationDetails)
-> Generic ClassificationDetails
forall x. Rep ClassificationDetails x -> ClassificationDetails
forall x. ClassificationDetails -> Rep ClassificationDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClassificationDetails x -> ClassificationDetails
$cfrom :: forall x. ClassificationDetails -> Rep ClassificationDetails x
Prelude.Generic)

-- |
-- Create a value of 'ClassificationDetails' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'detailedResultsLocation', 'classificationDetails_detailedResultsLocation' - The path to the folder or file (in Amazon S3) that contains the
-- corresponding sensitive data discovery result for the finding. If a
-- finding applies to a large archive or compressed file, this value is the
-- path to a folder. Otherwise, this value is the path to a file.
--
-- 'jobId', 'classificationDetails_jobId' - The unique identifier for the classification job that produced the
-- finding.
--
-- 'jobArn', 'classificationDetails_jobArn' - The Amazon Resource Name (ARN) of the classification job that produced
-- the finding.
--
-- 'result', 'classificationDetails_result' - The status and other details of the finding.
newClassificationDetails ::
  ClassificationDetails
newClassificationDetails :: ClassificationDetails
newClassificationDetails =
  ClassificationDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ClassificationResult
-> ClassificationDetails
ClassificationDetails'
    { $sel:detailedResultsLocation:ClassificationDetails' :: Maybe Text
detailedResultsLocation =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:ClassificationDetails' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobArn:ClassificationDetails' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:result:ClassificationDetails' :: Maybe ClassificationResult
result = Maybe ClassificationResult
forall a. Maybe a
Prelude.Nothing
    }

-- | The path to the folder or file (in Amazon S3) that contains the
-- corresponding sensitive data discovery result for the finding. If a
-- finding applies to a large archive or compressed file, this value is the
-- path to a folder. Otherwise, this value is the path to a file.
classificationDetails_detailedResultsLocation :: Lens.Lens' ClassificationDetails (Prelude.Maybe Prelude.Text)
classificationDetails_detailedResultsLocation :: (Maybe Text -> f (Maybe Text))
-> ClassificationDetails -> f ClassificationDetails
classificationDetails_detailedResultsLocation = (ClassificationDetails -> Maybe Text)
-> (ClassificationDetails -> Maybe Text -> ClassificationDetails)
-> Lens
     ClassificationDetails
     ClassificationDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationDetails' {Maybe Text
detailedResultsLocation :: Maybe Text
$sel:detailedResultsLocation:ClassificationDetails' :: ClassificationDetails -> Maybe Text
detailedResultsLocation} -> Maybe Text
detailedResultsLocation) (\s :: ClassificationDetails
s@ClassificationDetails' {} Maybe Text
a -> ClassificationDetails
s {$sel:detailedResultsLocation:ClassificationDetails' :: Maybe Text
detailedResultsLocation = Maybe Text
a} :: ClassificationDetails)

-- | The unique identifier for the classification job that produced the
-- finding.
classificationDetails_jobId :: Lens.Lens' ClassificationDetails (Prelude.Maybe Prelude.Text)
classificationDetails_jobId :: (Maybe Text -> f (Maybe Text))
-> ClassificationDetails -> f ClassificationDetails
classificationDetails_jobId = (ClassificationDetails -> Maybe Text)
-> (ClassificationDetails -> Maybe Text -> ClassificationDetails)
-> Lens
     ClassificationDetails
     ClassificationDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationDetails' {Maybe Text
jobId :: Maybe Text
$sel:jobId:ClassificationDetails' :: ClassificationDetails -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: ClassificationDetails
s@ClassificationDetails' {} Maybe Text
a -> ClassificationDetails
s {$sel:jobId:ClassificationDetails' :: Maybe Text
jobId = Maybe Text
a} :: ClassificationDetails)

-- | The Amazon Resource Name (ARN) of the classification job that produced
-- the finding.
classificationDetails_jobArn :: Lens.Lens' ClassificationDetails (Prelude.Maybe Prelude.Text)
classificationDetails_jobArn :: (Maybe Text -> f (Maybe Text))
-> ClassificationDetails -> f ClassificationDetails
classificationDetails_jobArn = (ClassificationDetails -> Maybe Text)
-> (ClassificationDetails -> Maybe Text -> ClassificationDetails)
-> Lens
     ClassificationDetails
     ClassificationDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationDetails' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:ClassificationDetails' :: ClassificationDetails -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: ClassificationDetails
s@ClassificationDetails' {} Maybe Text
a -> ClassificationDetails
s {$sel:jobArn:ClassificationDetails' :: Maybe Text
jobArn = Maybe Text
a} :: ClassificationDetails)

-- | The status and other details of the finding.
classificationDetails_result :: Lens.Lens' ClassificationDetails (Prelude.Maybe ClassificationResult)
classificationDetails_result :: (Maybe ClassificationResult -> f (Maybe ClassificationResult))
-> ClassificationDetails -> f ClassificationDetails
classificationDetails_result = (ClassificationDetails -> Maybe ClassificationResult)
-> (ClassificationDetails
    -> Maybe ClassificationResult -> ClassificationDetails)
-> Lens
     ClassificationDetails
     ClassificationDetails
     (Maybe ClassificationResult)
     (Maybe ClassificationResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationDetails' {Maybe ClassificationResult
result :: Maybe ClassificationResult
$sel:result:ClassificationDetails' :: ClassificationDetails -> Maybe ClassificationResult
result} -> Maybe ClassificationResult
result) (\s :: ClassificationDetails
s@ClassificationDetails' {} Maybe ClassificationResult
a -> ClassificationDetails
s {$sel:result:ClassificationDetails' :: Maybe ClassificationResult
result = Maybe ClassificationResult
a} :: ClassificationDetails)

instance Core.FromJSON ClassificationDetails where
  parseJSON :: Value -> Parser ClassificationDetails
parseJSON =
    String
-> (Object -> Parser ClassificationDetails)
-> Value
-> Parser ClassificationDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ClassificationDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ClassificationResult
-> ClassificationDetails
ClassificationDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ClassificationResult
 -> ClassificationDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ClassificationResult
      -> ClassificationDetails)
forall (f :: * -> *) a b. Functor 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
"detailedResultsLocation")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ClassificationResult
   -> ClassificationDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe ClassificationResult -> ClassificationDetails)
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
"jobId")
            Parser
  (Maybe Text -> Maybe ClassificationResult -> ClassificationDetails)
-> Parser (Maybe Text)
-> Parser (Maybe ClassificationResult -> ClassificationDetails)
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
"jobArn")
            Parser (Maybe ClassificationResult -> ClassificationDetails)
-> Parser (Maybe ClassificationResult)
-> Parser ClassificationDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClassificationResult)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"result")
      )

instance Prelude.Hashable ClassificationDetails

instance Prelude.NFData ClassificationDetails