{-# 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.DetectedDataDetails
-- 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.DetectedDataDetails 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

-- | Specifies 1-10 occurrences of a specific type of sensitive data reported
-- by a finding.
--
-- /See:/ 'newDetectedDataDetails' smart constructor.
data DetectedDataDetails = DetectedDataDetails'
  { -- | An occurrence of the specified type of sensitive data. Each occurrence
    -- can contain 1-128 characters.
    DetectedDataDetails -> Text
value :: Prelude.Text
  }
  deriving (DetectedDataDetails -> DetectedDataDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectedDataDetails -> DetectedDataDetails -> Bool
$c/= :: DetectedDataDetails -> DetectedDataDetails -> Bool
== :: DetectedDataDetails -> DetectedDataDetails -> Bool
$c== :: DetectedDataDetails -> DetectedDataDetails -> Bool
Prelude.Eq, ReadPrec [DetectedDataDetails]
ReadPrec DetectedDataDetails
Int -> ReadS DetectedDataDetails
ReadS [DetectedDataDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectedDataDetails]
$creadListPrec :: ReadPrec [DetectedDataDetails]
readPrec :: ReadPrec DetectedDataDetails
$creadPrec :: ReadPrec DetectedDataDetails
readList :: ReadS [DetectedDataDetails]
$creadList :: ReadS [DetectedDataDetails]
readsPrec :: Int -> ReadS DetectedDataDetails
$creadsPrec :: Int -> ReadS DetectedDataDetails
Prelude.Read, Int -> DetectedDataDetails -> ShowS
[DetectedDataDetails] -> ShowS
DetectedDataDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectedDataDetails] -> ShowS
$cshowList :: [DetectedDataDetails] -> ShowS
show :: DetectedDataDetails -> String
$cshow :: DetectedDataDetails -> String
showsPrec :: Int -> DetectedDataDetails -> ShowS
$cshowsPrec :: Int -> DetectedDataDetails -> ShowS
Prelude.Show, forall x. Rep DetectedDataDetails x -> DetectedDataDetails
forall x. DetectedDataDetails -> Rep DetectedDataDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectedDataDetails x -> DetectedDataDetails
$cfrom :: forall x. DetectedDataDetails -> Rep DetectedDataDetails x
Prelude.Generic)

-- |
-- Create a value of 'DetectedDataDetails' 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:
--
-- 'value', 'detectedDataDetails_value' - An occurrence of the specified type of sensitive data. Each occurrence
-- can contain 1-128 characters.
newDetectedDataDetails ::
  -- | 'value'
  Prelude.Text ->
  DetectedDataDetails
newDetectedDataDetails :: Text -> DetectedDataDetails
newDetectedDataDetails Text
pValue_ =
  DetectedDataDetails' {$sel:value:DetectedDataDetails' :: Text
value = Text
pValue_}

-- | An occurrence of the specified type of sensitive data. Each occurrence
-- can contain 1-128 characters.
detectedDataDetails_value :: Lens.Lens' DetectedDataDetails Prelude.Text
detectedDataDetails_value :: Lens' DetectedDataDetails Text
detectedDataDetails_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectedDataDetails' {Text
value :: Text
$sel:value:DetectedDataDetails' :: DetectedDataDetails -> Text
value} -> Text
value) (\s :: DetectedDataDetails
s@DetectedDataDetails' {} Text
a -> DetectedDataDetails
s {$sel:value:DetectedDataDetails' :: Text
value = Text
a} :: DetectedDataDetails)

instance Data.FromJSON DetectedDataDetails where
  parseJSON :: Value -> Parser DetectedDataDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DetectedDataDetails"
      ( \Object
x ->
          Text -> DetectedDataDetails
DetectedDataDetails' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"value")
      )

instance Prelude.Hashable DetectedDataDetails where
  hashWithSalt :: Int -> DetectedDataDetails -> Int
hashWithSalt Int
_salt DetectedDataDetails' {Text
value :: Text
$sel:value:DetectedDataDetails' :: DetectedDataDetails -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value

instance Prelude.NFData DetectedDataDetails where
  rnf :: DetectedDataDetails -> ()
rnf DetectedDataDetails' {Text
value :: Text
$sel:value:DetectedDataDetails' :: DetectedDataDetails -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
value