{-# 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.ResourceProfileArtifact
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.ResourceProfileArtifact where

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

-- | Provides information about an S3 object that Amazon Macie selected for
-- analysis while performing automated sensitive data discovery for an S3
-- bucket, and the status and results of the analysis. This information is
-- available only if automated sensitive data discovery is currently
-- enabled for your account.
--
-- /See:/ 'newResourceProfileArtifact' smart constructor.
data ResourceProfileArtifact = ResourceProfileArtifact'
  { -- | Specifies whether Amazon Macie found sensitive data in the object.
    ResourceProfileArtifact -> Maybe Bool
sensitive :: Prelude.Maybe Prelude.Bool,
    -- | The status of the analysis. Possible values are:
    --
    -- -   COMPLETE - Amazon Macie successfully completed its analysis of the
    --     object.
    --
    -- -   PARTIAL - Macie analyzed only a subset of data in the object. For
    --     example, the object is an archive file that contains files in an
    --     unsupported format.
    --
    -- -   SKIPPED - Macie wasn\'t able to analyze the object. For example, the
    --     object is a malformed file.
    ResourceProfileArtifact -> Text
classificationResultStatus :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the object.
    ResourceProfileArtifact -> Text
arn :: Prelude.Text
  }
  deriving (ResourceProfileArtifact -> ResourceProfileArtifact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceProfileArtifact -> ResourceProfileArtifact -> Bool
$c/= :: ResourceProfileArtifact -> ResourceProfileArtifact -> Bool
== :: ResourceProfileArtifact -> ResourceProfileArtifact -> Bool
$c== :: ResourceProfileArtifact -> ResourceProfileArtifact -> Bool
Prelude.Eq, ReadPrec [ResourceProfileArtifact]
ReadPrec ResourceProfileArtifact
Int -> ReadS ResourceProfileArtifact
ReadS [ResourceProfileArtifact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceProfileArtifact]
$creadListPrec :: ReadPrec [ResourceProfileArtifact]
readPrec :: ReadPrec ResourceProfileArtifact
$creadPrec :: ReadPrec ResourceProfileArtifact
readList :: ReadS [ResourceProfileArtifact]
$creadList :: ReadS [ResourceProfileArtifact]
readsPrec :: Int -> ReadS ResourceProfileArtifact
$creadsPrec :: Int -> ReadS ResourceProfileArtifact
Prelude.Read, Int -> ResourceProfileArtifact -> ShowS
[ResourceProfileArtifact] -> ShowS
ResourceProfileArtifact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceProfileArtifact] -> ShowS
$cshowList :: [ResourceProfileArtifact] -> ShowS
show :: ResourceProfileArtifact -> String
$cshow :: ResourceProfileArtifact -> String
showsPrec :: Int -> ResourceProfileArtifact -> ShowS
$cshowsPrec :: Int -> ResourceProfileArtifact -> ShowS
Prelude.Show, forall x. Rep ResourceProfileArtifact x -> ResourceProfileArtifact
forall x. ResourceProfileArtifact -> Rep ResourceProfileArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceProfileArtifact x -> ResourceProfileArtifact
$cfrom :: forall x. ResourceProfileArtifact -> Rep ResourceProfileArtifact x
Prelude.Generic)

-- |
-- Create a value of 'ResourceProfileArtifact' 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:
--
-- 'sensitive', 'resourceProfileArtifact_sensitive' - Specifies whether Amazon Macie found sensitive data in the object.
--
-- 'classificationResultStatus', 'resourceProfileArtifact_classificationResultStatus' - The status of the analysis. Possible values are:
--
-- -   COMPLETE - Amazon Macie successfully completed its analysis of the
--     object.
--
-- -   PARTIAL - Macie analyzed only a subset of data in the object. For
--     example, the object is an archive file that contains files in an
--     unsupported format.
--
-- -   SKIPPED - Macie wasn\'t able to analyze the object. For example, the
--     object is a malformed file.
--
-- 'arn', 'resourceProfileArtifact_arn' - The Amazon Resource Name (ARN) of the object.
newResourceProfileArtifact ::
  -- | 'classificationResultStatus'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  ResourceProfileArtifact
newResourceProfileArtifact :: Text -> Text -> ResourceProfileArtifact
newResourceProfileArtifact
  Text
pClassificationResultStatus_
  Text
pArn_ =
    ResourceProfileArtifact'
      { $sel:sensitive:ResourceProfileArtifact' :: Maybe Bool
sensitive =
          forall a. Maybe a
Prelude.Nothing,
        $sel:classificationResultStatus:ResourceProfileArtifact' :: Text
classificationResultStatus =
          Text
pClassificationResultStatus_,
        $sel:arn:ResourceProfileArtifact' :: Text
arn = Text
pArn_
      }

-- | Specifies whether Amazon Macie found sensitive data in the object.
resourceProfileArtifact_sensitive :: Lens.Lens' ResourceProfileArtifact (Prelude.Maybe Prelude.Bool)
resourceProfileArtifact_sensitive :: Lens' ResourceProfileArtifact (Maybe Bool)
resourceProfileArtifact_sensitive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceProfileArtifact' {Maybe Bool
sensitive :: Maybe Bool
$sel:sensitive:ResourceProfileArtifact' :: ResourceProfileArtifact -> Maybe Bool
sensitive} -> Maybe Bool
sensitive) (\s :: ResourceProfileArtifact
s@ResourceProfileArtifact' {} Maybe Bool
a -> ResourceProfileArtifact
s {$sel:sensitive:ResourceProfileArtifact' :: Maybe Bool
sensitive = Maybe Bool
a} :: ResourceProfileArtifact)

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

-- | The Amazon Resource Name (ARN) of the object.
resourceProfileArtifact_arn :: Lens.Lens' ResourceProfileArtifact Prelude.Text
resourceProfileArtifact_arn :: Lens' ResourceProfileArtifact Text
resourceProfileArtifact_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceProfileArtifact' {Text
arn :: Text
$sel:arn:ResourceProfileArtifact' :: ResourceProfileArtifact -> Text
arn} -> Text
arn) (\s :: ResourceProfileArtifact
s@ResourceProfileArtifact' {} Text
a -> ResourceProfileArtifact
s {$sel:arn:ResourceProfileArtifact' :: Text
arn = Text
a} :: ResourceProfileArtifact)

instance Data.FromJSON ResourceProfileArtifact where
  parseJSON :: Value -> Parser ResourceProfileArtifact
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ResourceProfileArtifact"
      ( \Object
x ->
          Maybe Bool -> Text -> Text -> ResourceProfileArtifact
ResourceProfileArtifact'
            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
"sensitive")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"classificationResultStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"arn")
      )

instance Prelude.Hashable ResourceProfileArtifact where
  hashWithSalt :: Int -> ResourceProfileArtifact -> Int
hashWithSalt Int
_salt ResourceProfileArtifact' {Maybe Bool
Text
arn :: Text
classificationResultStatus :: Text
sensitive :: Maybe Bool
$sel:arn:ResourceProfileArtifact' :: ResourceProfileArtifact -> Text
$sel:classificationResultStatus:ResourceProfileArtifact' :: ResourceProfileArtifact -> Text
$sel:sensitive:ResourceProfileArtifact' :: ResourceProfileArtifact -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
sensitive
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
classificationResultStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData ResourceProfileArtifact where
  rnf :: ResourceProfileArtifact -> ()
rnf ResourceProfileArtifact' {Maybe Bool
Text
arn :: Text
classificationResultStatus :: Text
sensitive :: Maybe Bool
$sel:arn:ResourceProfileArtifact' :: ResourceProfileArtifact -> Text
$sel:classificationResultStatus:ResourceProfileArtifact' :: ResourceProfileArtifact -> Text
$sel:sensitive:ResourceProfileArtifact' :: ResourceProfileArtifact -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
sensitive
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
classificationResultStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn