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

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

-- | Provides information about a managed data identifier. For additional
-- information, see
-- <https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html Using managed data identifiers>
-- in the /Amazon Macie User Guide/.
--
-- /See:/ 'newManagedDataIdentifierSummary' smart constructor.
data ManagedDataIdentifierSummary = ManagedDataIdentifierSummary'
  { -- | The category of sensitive data that the managed data identifier detects:
    -- CREDENTIALS, for credentials data such as private keys or Amazon Web
    -- Services secret keys; FINANCIAL_INFORMATION, for financial data such as
    -- credit card numbers; or, PERSONAL_INFORMATION, for personal health
    -- information, such as health insurance identification numbers, or
    -- personally identifiable information, such as passport numbers.
    ManagedDataIdentifierSummary -> Maybe SensitiveDataItemCategory
category :: Prelude.Maybe SensitiveDataItemCategory,
    -- | The unique identifier for the managed data identifier. This is a string
    -- that describes the type of sensitive data that the managed data
    -- identifier detects. For example: OPENSSH_PRIVATE_KEY for OpenSSH private
    -- keys, CREDIT_CARD_NUMBER for credit card numbers, or USA_PASSPORT_NUMBER
    -- for US passport numbers.
    ManagedDataIdentifierSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (ManagedDataIdentifierSummary
-> ManagedDataIdentifierSummary -> Bool
(ManagedDataIdentifierSummary
 -> ManagedDataIdentifierSummary -> Bool)
-> (ManagedDataIdentifierSummary
    -> ManagedDataIdentifierSummary -> Bool)
-> Eq ManagedDataIdentifierSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedDataIdentifierSummary
-> ManagedDataIdentifierSummary -> Bool
$c/= :: ManagedDataIdentifierSummary
-> ManagedDataIdentifierSummary -> Bool
== :: ManagedDataIdentifierSummary
-> ManagedDataIdentifierSummary -> Bool
$c== :: ManagedDataIdentifierSummary
-> ManagedDataIdentifierSummary -> Bool
Prelude.Eq, ReadPrec [ManagedDataIdentifierSummary]
ReadPrec ManagedDataIdentifierSummary
Int -> ReadS ManagedDataIdentifierSummary
ReadS [ManagedDataIdentifierSummary]
(Int -> ReadS ManagedDataIdentifierSummary)
-> ReadS [ManagedDataIdentifierSummary]
-> ReadPrec ManagedDataIdentifierSummary
-> ReadPrec [ManagedDataIdentifierSummary]
-> Read ManagedDataIdentifierSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedDataIdentifierSummary]
$creadListPrec :: ReadPrec [ManagedDataIdentifierSummary]
readPrec :: ReadPrec ManagedDataIdentifierSummary
$creadPrec :: ReadPrec ManagedDataIdentifierSummary
readList :: ReadS [ManagedDataIdentifierSummary]
$creadList :: ReadS [ManagedDataIdentifierSummary]
readsPrec :: Int -> ReadS ManagedDataIdentifierSummary
$creadsPrec :: Int -> ReadS ManagedDataIdentifierSummary
Prelude.Read, Int -> ManagedDataIdentifierSummary -> ShowS
[ManagedDataIdentifierSummary] -> ShowS
ManagedDataIdentifierSummary -> String
(Int -> ManagedDataIdentifierSummary -> ShowS)
-> (ManagedDataIdentifierSummary -> String)
-> ([ManagedDataIdentifierSummary] -> ShowS)
-> Show ManagedDataIdentifierSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedDataIdentifierSummary] -> ShowS
$cshowList :: [ManagedDataIdentifierSummary] -> ShowS
show :: ManagedDataIdentifierSummary -> String
$cshow :: ManagedDataIdentifierSummary -> String
showsPrec :: Int -> ManagedDataIdentifierSummary -> ShowS
$cshowsPrec :: Int -> ManagedDataIdentifierSummary -> ShowS
Prelude.Show, (forall x.
 ManagedDataIdentifierSummary -> Rep ManagedDataIdentifierSummary x)
-> (forall x.
    Rep ManagedDataIdentifierSummary x -> ManagedDataIdentifierSummary)
-> Generic ManagedDataIdentifierSummary
forall x.
Rep ManagedDataIdentifierSummary x -> ManagedDataIdentifierSummary
forall x.
ManagedDataIdentifierSummary -> Rep ManagedDataIdentifierSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ManagedDataIdentifierSummary x -> ManagedDataIdentifierSummary
$cfrom :: forall x.
ManagedDataIdentifierSummary -> Rep ManagedDataIdentifierSummary x
Prelude.Generic)

-- |
-- Create a value of 'ManagedDataIdentifierSummary' 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:
--
-- 'category', 'managedDataIdentifierSummary_category' - The category of sensitive data that the managed data identifier detects:
-- CREDENTIALS, for credentials data such as private keys or Amazon Web
-- Services secret keys; FINANCIAL_INFORMATION, for financial data such as
-- credit card numbers; or, PERSONAL_INFORMATION, for personal health
-- information, such as health insurance identification numbers, or
-- personally identifiable information, such as passport numbers.
--
-- 'id', 'managedDataIdentifierSummary_id' - The unique identifier for the managed data identifier. This is a string
-- that describes the type of sensitive data that the managed data
-- identifier detects. For example: OPENSSH_PRIVATE_KEY for OpenSSH private
-- keys, CREDIT_CARD_NUMBER for credit card numbers, or USA_PASSPORT_NUMBER
-- for US passport numbers.
newManagedDataIdentifierSummary ::
  ManagedDataIdentifierSummary
newManagedDataIdentifierSummary :: ManagedDataIdentifierSummary
newManagedDataIdentifierSummary =
  ManagedDataIdentifierSummary' :: Maybe SensitiveDataItemCategory
-> Maybe Text -> ManagedDataIdentifierSummary
ManagedDataIdentifierSummary'
    { $sel:category:ManagedDataIdentifierSummary' :: Maybe SensitiveDataItemCategory
category =
        Maybe SensitiveDataItemCategory
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ManagedDataIdentifierSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The category of sensitive data that the managed data identifier detects:
-- CREDENTIALS, for credentials data such as private keys or Amazon Web
-- Services secret keys; FINANCIAL_INFORMATION, for financial data such as
-- credit card numbers; or, PERSONAL_INFORMATION, for personal health
-- information, such as health insurance identification numbers, or
-- personally identifiable information, such as passport numbers.
managedDataIdentifierSummary_category :: Lens.Lens' ManagedDataIdentifierSummary (Prelude.Maybe SensitiveDataItemCategory)
managedDataIdentifierSummary_category :: (Maybe SensitiveDataItemCategory
 -> f (Maybe SensitiveDataItemCategory))
-> ManagedDataIdentifierSummary -> f ManagedDataIdentifierSummary
managedDataIdentifierSummary_category = (ManagedDataIdentifierSummary -> Maybe SensitiveDataItemCategory)
-> (ManagedDataIdentifierSummary
    -> Maybe SensitiveDataItemCategory -> ManagedDataIdentifierSummary)
-> Lens
     ManagedDataIdentifierSummary
     ManagedDataIdentifierSummary
     (Maybe SensitiveDataItemCategory)
     (Maybe SensitiveDataItemCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedDataIdentifierSummary' {Maybe SensitiveDataItemCategory
category :: Maybe SensitiveDataItemCategory
$sel:category:ManagedDataIdentifierSummary' :: ManagedDataIdentifierSummary -> Maybe SensitiveDataItemCategory
category} -> Maybe SensitiveDataItemCategory
category) (\s :: ManagedDataIdentifierSummary
s@ManagedDataIdentifierSummary' {} Maybe SensitiveDataItemCategory
a -> ManagedDataIdentifierSummary
s {$sel:category:ManagedDataIdentifierSummary' :: Maybe SensitiveDataItemCategory
category = Maybe SensitiveDataItemCategory
a} :: ManagedDataIdentifierSummary)

-- | The unique identifier for the managed data identifier. This is a string
-- that describes the type of sensitive data that the managed data
-- identifier detects. For example: OPENSSH_PRIVATE_KEY for OpenSSH private
-- keys, CREDIT_CARD_NUMBER for credit card numbers, or USA_PASSPORT_NUMBER
-- for US passport numbers.
managedDataIdentifierSummary_id :: Lens.Lens' ManagedDataIdentifierSummary (Prelude.Maybe Prelude.Text)
managedDataIdentifierSummary_id :: (Maybe Text -> f (Maybe Text))
-> ManagedDataIdentifierSummary -> f ManagedDataIdentifierSummary
managedDataIdentifierSummary_id = (ManagedDataIdentifierSummary -> Maybe Text)
-> (ManagedDataIdentifierSummary
    -> Maybe Text -> ManagedDataIdentifierSummary)
-> Lens
     ManagedDataIdentifierSummary
     ManagedDataIdentifierSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedDataIdentifierSummary' {Maybe Text
id :: Maybe Text
$sel:id:ManagedDataIdentifierSummary' :: ManagedDataIdentifierSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ManagedDataIdentifierSummary
s@ManagedDataIdentifierSummary' {} Maybe Text
a -> ManagedDataIdentifierSummary
s {$sel:id:ManagedDataIdentifierSummary' :: Maybe Text
id = Maybe Text
a} :: ManagedDataIdentifierSummary)

instance Core.FromJSON ManagedDataIdentifierSummary where
  parseJSON :: Value -> Parser ManagedDataIdentifierSummary
parseJSON =
    String
-> (Object -> Parser ManagedDataIdentifierSummary)
-> Value
-> Parser ManagedDataIdentifierSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ManagedDataIdentifierSummary"
      ( \Object
x ->
          Maybe SensitiveDataItemCategory
-> Maybe Text -> ManagedDataIdentifierSummary
ManagedDataIdentifierSummary'
            (Maybe SensitiveDataItemCategory
 -> Maybe Text -> ManagedDataIdentifierSummary)
-> Parser (Maybe SensitiveDataItemCategory)
-> Parser (Maybe Text -> ManagedDataIdentifierSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SensitiveDataItemCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"category")
            Parser (Maybe Text -> ManagedDataIdentifierSummary)
-> Parser (Maybe Text) -> Parser ManagedDataIdentifierSummary
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
"id")
      )

instance
  Prelude.Hashable
    ManagedDataIdentifierSummary

instance Prelude.NFData ManagedDataIdentifierSummary