{-# 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.ClassificationResultStatus
-- 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.ClassificationResultStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the status of a sensitive data finding.
--
-- /See:/ 'newClassificationResultStatus' smart constructor.
data ClassificationResultStatus = ClassificationResultStatus'
  { -- | A brief description of the status of the finding. Amazon Macie uses this
    -- value to notify you of any errors, warnings, or considerations that
    -- might impact your analysis of the finding.
    ClassificationResultStatus -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
    -- | The status of the finding. Possible values are:
    --
    -- -   COMPLETE - Amazon Macie successfully completed its analysis of the
    --     S3 object that the finding applies to.
    --
    -- -   PARTIAL - Macie analyzed only a subset of the data in the S3 object
    --     that the finding applies to. For example, the object is an archive
    --     file that contains files in an unsupported format.
    --
    -- -   SKIPPED - Macie wasn\'t able to analyze the S3 object that the
    --     finding applies to. For example, the object is a file in an
    --     unsupported format.
    ClassificationResultStatus -> Maybe Text
code :: Prelude.Maybe Prelude.Text
  }
  deriving (ClassificationResultStatus -> ClassificationResultStatus -> Bool
(ClassificationResultStatus -> ClassificationResultStatus -> Bool)
-> (ClassificationResultStatus
    -> ClassificationResultStatus -> Bool)
-> Eq ClassificationResultStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassificationResultStatus -> ClassificationResultStatus -> Bool
$c/= :: ClassificationResultStatus -> ClassificationResultStatus -> Bool
== :: ClassificationResultStatus -> ClassificationResultStatus -> Bool
$c== :: ClassificationResultStatus -> ClassificationResultStatus -> Bool
Prelude.Eq, ReadPrec [ClassificationResultStatus]
ReadPrec ClassificationResultStatus
Int -> ReadS ClassificationResultStatus
ReadS [ClassificationResultStatus]
(Int -> ReadS ClassificationResultStatus)
-> ReadS [ClassificationResultStatus]
-> ReadPrec ClassificationResultStatus
-> ReadPrec [ClassificationResultStatus]
-> Read ClassificationResultStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClassificationResultStatus]
$creadListPrec :: ReadPrec [ClassificationResultStatus]
readPrec :: ReadPrec ClassificationResultStatus
$creadPrec :: ReadPrec ClassificationResultStatus
readList :: ReadS [ClassificationResultStatus]
$creadList :: ReadS [ClassificationResultStatus]
readsPrec :: Int -> ReadS ClassificationResultStatus
$creadsPrec :: Int -> ReadS ClassificationResultStatus
Prelude.Read, Int -> ClassificationResultStatus -> ShowS
[ClassificationResultStatus] -> ShowS
ClassificationResultStatus -> String
(Int -> ClassificationResultStatus -> ShowS)
-> (ClassificationResultStatus -> String)
-> ([ClassificationResultStatus] -> ShowS)
-> Show ClassificationResultStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassificationResultStatus] -> ShowS
$cshowList :: [ClassificationResultStatus] -> ShowS
show :: ClassificationResultStatus -> String
$cshow :: ClassificationResultStatus -> String
showsPrec :: Int -> ClassificationResultStatus -> ShowS
$cshowsPrec :: Int -> ClassificationResultStatus -> ShowS
Prelude.Show, (forall x.
 ClassificationResultStatus -> Rep ClassificationResultStatus x)
-> (forall x.
    Rep ClassificationResultStatus x -> ClassificationResultStatus)
-> Generic ClassificationResultStatus
forall x.
Rep ClassificationResultStatus x -> ClassificationResultStatus
forall x.
ClassificationResultStatus -> Rep ClassificationResultStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClassificationResultStatus x -> ClassificationResultStatus
$cfrom :: forall x.
ClassificationResultStatus -> Rep ClassificationResultStatus x
Prelude.Generic)

-- |
-- Create a value of 'ClassificationResultStatus' 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:
--
-- 'reason', 'classificationResultStatus_reason' - A brief description of the status of the finding. Amazon Macie uses this
-- value to notify you of any errors, warnings, or considerations that
-- might impact your analysis of the finding.
--
-- 'code', 'classificationResultStatus_code' - The status of the finding. Possible values are:
--
-- -   COMPLETE - Amazon Macie successfully completed its analysis of the
--     S3 object that the finding applies to.
--
-- -   PARTIAL - Macie analyzed only a subset of the data in the S3 object
--     that the finding applies to. For example, the object is an archive
--     file that contains files in an unsupported format.
--
-- -   SKIPPED - Macie wasn\'t able to analyze the S3 object that the
--     finding applies to. For example, the object is a file in an
--     unsupported format.
newClassificationResultStatus ::
  ClassificationResultStatus
newClassificationResultStatus :: ClassificationResultStatus
newClassificationResultStatus =
  ClassificationResultStatus' :: Maybe Text -> Maybe Text -> ClassificationResultStatus
ClassificationResultStatus'
    { $sel:reason:ClassificationResultStatus' :: Maybe Text
reason =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:code:ClassificationResultStatus' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A brief description of the status of the finding. Amazon Macie uses this
-- value to notify you of any errors, warnings, or considerations that
-- might impact your analysis of the finding.
classificationResultStatus_reason :: Lens.Lens' ClassificationResultStatus (Prelude.Maybe Prelude.Text)
classificationResultStatus_reason :: (Maybe Text -> f (Maybe Text))
-> ClassificationResultStatus -> f ClassificationResultStatus
classificationResultStatus_reason = (ClassificationResultStatus -> Maybe Text)
-> (ClassificationResultStatus
    -> Maybe Text -> ClassificationResultStatus)
-> Lens
     ClassificationResultStatus
     ClassificationResultStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResultStatus' {Maybe Text
reason :: Maybe Text
$sel:reason:ClassificationResultStatus' :: ClassificationResultStatus -> Maybe Text
reason} -> Maybe Text
reason) (\s :: ClassificationResultStatus
s@ClassificationResultStatus' {} Maybe Text
a -> ClassificationResultStatus
s {$sel:reason:ClassificationResultStatus' :: Maybe Text
reason = Maybe Text
a} :: ClassificationResultStatus)

-- | The status of the finding. Possible values are:
--
-- -   COMPLETE - Amazon Macie successfully completed its analysis of the
--     S3 object that the finding applies to.
--
-- -   PARTIAL - Macie analyzed only a subset of the data in the S3 object
--     that the finding applies to. For example, the object is an archive
--     file that contains files in an unsupported format.
--
-- -   SKIPPED - Macie wasn\'t able to analyze the S3 object that the
--     finding applies to. For example, the object is a file in an
--     unsupported format.
classificationResultStatus_code :: Lens.Lens' ClassificationResultStatus (Prelude.Maybe Prelude.Text)
classificationResultStatus_code :: (Maybe Text -> f (Maybe Text))
-> ClassificationResultStatus -> f ClassificationResultStatus
classificationResultStatus_code = (ClassificationResultStatus -> Maybe Text)
-> (ClassificationResultStatus
    -> Maybe Text -> ClassificationResultStatus)
-> Lens
     ClassificationResultStatus
     ClassificationResultStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationResultStatus' {Maybe Text
code :: Maybe Text
$sel:code:ClassificationResultStatus' :: ClassificationResultStatus -> Maybe Text
code} -> Maybe Text
code) (\s :: ClassificationResultStatus
s@ClassificationResultStatus' {} Maybe Text
a -> ClassificationResultStatus
s {$sel:code:ClassificationResultStatus' :: Maybe Text
code = Maybe Text
a} :: ClassificationResultStatus)

instance Core.FromJSON ClassificationResultStatus where
  parseJSON :: Value -> Parser ClassificationResultStatus
parseJSON =
    String
-> (Object -> Parser ClassificationResultStatus)
-> Value
-> Parser ClassificationResultStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ClassificationResultStatus"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ClassificationResultStatus
ClassificationResultStatus'
            (Maybe Text -> Maybe Text -> ClassificationResultStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ClassificationResultStatus)
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
"reason")
            Parser (Maybe Text -> ClassificationResultStatus)
-> Parser (Maybe Text) -> Parser ClassificationResultStatus
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
"code")
      )

instance Prelude.Hashable ClassificationResultStatus

instance Prelude.NFData ClassificationResultStatus