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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.DataIdentifierType
import qualified Amazonka.Prelude as Prelude

-- | Specifies a custom data identifier or managed data identifier that
-- detected a type of sensitive data to start excluding or including in an
-- S3 bucket\'s sensitivity score.
--
-- /See:/ 'newSuppressDataIdentifier' smart constructor.
data SuppressDataIdentifier = SuppressDataIdentifier'
  { -- | The unique identifier for the custom data identifier or managed data
    -- identifier that detected the type of sensitive data to exclude or
    -- include in the score.
    SuppressDataIdentifier -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The type of data identifier that detected the sensitive data. Possible
    -- values are: CUSTOM, for a custom data identifier; and, MANAGED, for a
    -- managed data identifier.
    SuppressDataIdentifier -> Maybe DataIdentifierType
type' :: Prelude.Maybe DataIdentifierType
  }
  deriving (SuppressDataIdentifier -> SuppressDataIdentifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuppressDataIdentifier -> SuppressDataIdentifier -> Bool
$c/= :: SuppressDataIdentifier -> SuppressDataIdentifier -> Bool
== :: SuppressDataIdentifier -> SuppressDataIdentifier -> Bool
$c== :: SuppressDataIdentifier -> SuppressDataIdentifier -> Bool
Prelude.Eq, ReadPrec [SuppressDataIdentifier]
ReadPrec SuppressDataIdentifier
Int -> ReadS SuppressDataIdentifier
ReadS [SuppressDataIdentifier]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuppressDataIdentifier]
$creadListPrec :: ReadPrec [SuppressDataIdentifier]
readPrec :: ReadPrec SuppressDataIdentifier
$creadPrec :: ReadPrec SuppressDataIdentifier
readList :: ReadS [SuppressDataIdentifier]
$creadList :: ReadS [SuppressDataIdentifier]
readsPrec :: Int -> ReadS SuppressDataIdentifier
$creadsPrec :: Int -> ReadS SuppressDataIdentifier
Prelude.Read, Int -> SuppressDataIdentifier -> ShowS
[SuppressDataIdentifier] -> ShowS
SuppressDataIdentifier -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuppressDataIdentifier] -> ShowS
$cshowList :: [SuppressDataIdentifier] -> ShowS
show :: SuppressDataIdentifier -> String
$cshow :: SuppressDataIdentifier -> String
showsPrec :: Int -> SuppressDataIdentifier -> ShowS
$cshowsPrec :: Int -> SuppressDataIdentifier -> ShowS
Prelude.Show, forall x. Rep SuppressDataIdentifier x -> SuppressDataIdentifier
forall x. SuppressDataIdentifier -> Rep SuppressDataIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuppressDataIdentifier x -> SuppressDataIdentifier
$cfrom :: forall x. SuppressDataIdentifier -> Rep SuppressDataIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'SuppressDataIdentifier' 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:
--
-- 'id', 'suppressDataIdentifier_id' - The unique identifier for the custom data identifier or managed data
-- identifier that detected the type of sensitive data to exclude or
-- include in the score.
--
-- 'type'', 'suppressDataIdentifier_type' - The type of data identifier that detected the sensitive data. Possible
-- values are: CUSTOM, for a custom data identifier; and, MANAGED, for a
-- managed data identifier.
newSuppressDataIdentifier ::
  SuppressDataIdentifier
newSuppressDataIdentifier :: SuppressDataIdentifier
newSuppressDataIdentifier =
  SuppressDataIdentifier'
    { $sel:id:SuppressDataIdentifier' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:type':SuppressDataIdentifier' :: Maybe DataIdentifierType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for the custom data identifier or managed data
-- identifier that detected the type of sensitive data to exclude or
-- include in the score.
suppressDataIdentifier_id :: Lens.Lens' SuppressDataIdentifier (Prelude.Maybe Prelude.Text)
suppressDataIdentifier_id :: Lens' SuppressDataIdentifier (Maybe Text)
suppressDataIdentifier_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressDataIdentifier' {Maybe Text
id :: Maybe Text
$sel:id:SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe Text
id} -> Maybe Text
id) (\s :: SuppressDataIdentifier
s@SuppressDataIdentifier' {} Maybe Text
a -> SuppressDataIdentifier
s {$sel:id:SuppressDataIdentifier' :: Maybe Text
id = Maybe Text
a} :: SuppressDataIdentifier)

-- | The type of data identifier that detected the sensitive data. Possible
-- values are: CUSTOM, for a custom data identifier; and, MANAGED, for a
-- managed data identifier.
suppressDataIdentifier_type :: Lens.Lens' SuppressDataIdentifier (Prelude.Maybe DataIdentifierType)
suppressDataIdentifier_type :: Lens' SuppressDataIdentifier (Maybe DataIdentifierType)
suppressDataIdentifier_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuppressDataIdentifier' {Maybe DataIdentifierType
type' :: Maybe DataIdentifierType
$sel:type':SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe DataIdentifierType
type'} -> Maybe DataIdentifierType
type') (\s :: SuppressDataIdentifier
s@SuppressDataIdentifier' {} Maybe DataIdentifierType
a -> SuppressDataIdentifier
s {$sel:type':SuppressDataIdentifier' :: Maybe DataIdentifierType
type' = Maybe DataIdentifierType
a} :: SuppressDataIdentifier)

instance Prelude.Hashable SuppressDataIdentifier where
  hashWithSalt :: Int -> SuppressDataIdentifier -> Int
hashWithSalt Int
_salt SuppressDataIdentifier' {Maybe Text
Maybe DataIdentifierType
type' :: Maybe DataIdentifierType
id :: Maybe Text
$sel:type':SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe DataIdentifierType
$sel:id:SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataIdentifierType
type'

instance Prelude.NFData SuppressDataIdentifier where
  rnf :: SuppressDataIdentifier -> ()
rnf SuppressDataIdentifier' {Maybe Text
Maybe DataIdentifierType
type' :: Maybe DataIdentifierType
id :: Maybe Text
$sel:type':SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe DataIdentifierType
$sel:id:SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataIdentifierType
type'

instance Data.ToJSON SuppressDataIdentifier where
  toJSON :: SuppressDataIdentifier -> Value
toJSON SuppressDataIdentifier' {Maybe Text
Maybe DataIdentifierType
type' :: Maybe DataIdentifierType
id :: Maybe Text
$sel:type':SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe DataIdentifierType
$sel:id:SuppressDataIdentifier' :: SuppressDataIdentifier -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id,
            (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataIdentifierType
type'
          ]
      )