{-# 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.SensitivityInspectionTemplateIncludes
-- 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.SensitivityInspectionTemplateIncludes 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 the allow lists, custom data identifiers, and managed data
-- identifiers to include (use) when performing automated sensitive data
-- discovery for an Amazon Macie account. The configuration must specify at
-- least one custom data identifier or managed data identifier. For
-- information about the managed data identifiers that Amazon Macie
-- currently provides, see
-- <https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html Using managed data identifiers>
-- in the /Amazon Macie User Guide/.
--
-- /See:/ 'newSensitivityInspectionTemplateIncludes' smart constructor.
data SensitivityInspectionTemplateIncludes = SensitivityInspectionTemplateIncludes'
  { -- | An array of unique identifiers, one for each allow list to include.
    SensitivityInspectionTemplateIncludes -> Maybe [Text]
allowListIds :: Prelude.Maybe [Prelude.Text],
    -- | An array of unique identifiers, one for each custom data identifier to
    -- include.
    SensitivityInspectionTemplateIncludes -> Maybe [Text]
customDataIdentifierIds :: Prelude.Maybe [Prelude.Text],
    -- | An array of unique identifiers, one for each managed data identifier to
    -- include.
    --
    -- Amazon Macie uses these managed data identifiers in addition to managed
    -- data identifiers that are subsequently released and recommended for
    -- automated sensitive data discovery. To retrieve a list of valid values
    -- for the managed data identifiers that are currently available, use the
    -- ListManagedDataIdentifiers operation.
    SensitivityInspectionTemplateIncludes -> Maybe [Text]
managedDataIdentifierIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (SensitivityInspectionTemplateIncludes
-> SensitivityInspectionTemplateIncludes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SensitivityInspectionTemplateIncludes
-> SensitivityInspectionTemplateIncludes -> Bool
$c/= :: SensitivityInspectionTemplateIncludes
-> SensitivityInspectionTemplateIncludes -> Bool
== :: SensitivityInspectionTemplateIncludes
-> SensitivityInspectionTemplateIncludes -> Bool
$c== :: SensitivityInspectionTemplateIncludes
-> SensitivityInspectionTemplateIncludes -> Bool
Prelude.Eq, ReadPrec [SensitivityInspectionTemplateIncludes]
ReadPrec SensitivityInspectionTemplateIncludes
Int -> ReadS SensitivityInspectionTemplateIncludes
ReadS [SensitivityInspectionTemplateIncludes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SensitivityInspectionTemplateIncludes]
$creadListPrec :: ReadPrec [SensitivityInspectionTemplateIncludes]
readPrec :: ReadPrec SensitivityInspectionTemplateIncludes
$creadPrec :: ReadPrec SensitivityInspectionTemplateIncludes
readList :: ReadS [SensitivityInspectionTemplateIncludes]
$creadList :: ReadS [SensitivityInspectionTemplateIncludes]
readsPrec :: Int -> ReadS SensitivityInspectionTemplateIncludes
$creadsPrec :: Int -> ReadS SensitivityInspectionTemplateIncludes
Prelude.Read, Int -> SensitivityInspectionTemplateIncludes -> ShowS
[SensitivityInspectionTemplateIncludes] -> ShowS
SensitivityInspectionTemplateIncludes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SensitivityInspectionTemplateIncludes] -> ShowS
$cshowList :: [SensitivityInspectionTemplateIncludes] -> ShowS
show :: SensitivityInspectionTemplateIncludes -> String
$cshow :: SensitivityInspectionTemplateIncludes -> String
showsPrec :: Int -> SensitivityInspectionTemplateIncludes -> ShowS
$cshowsPrec :: Int -> SensitivityInspectionTemplateIncludes -> ShowS
Prelude.Show, forall x.
Rep SensitivityInspectionTemplateIncludes x
-> SensitivityInspectionTemplateIncludes
forall x.
SensitivityInspectionTemplateIncludes
-> Rep SensitivityInspectionTemplateIncludes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SensitivityInspectionTemplateIncludes x
-> SensitivityInspectionTemplateIncludes
$cfrom :: forall x.
SensitivityInspectionTemplateIncludes
-> Rep SensitivityInspectionTemplateIncludes x
Prelude.Generic)

-- |
-- Create a value of 'SensitivityInspectionTemplateIncludes' 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:
--
-- 'allowListIds', 'sensitivityInspectionTemplateIncludes_allowListIds' - An array of unique identifiers, one for each allow list to include.
--
-- 'customDataIdentifierIds', 'sensitivityInspectionTemplateIncludes_customDataIdentifierIds' - An array of unique identifiers, one for each custom data identifier to
-- include.
--
-- 'managedDataIdentifierIds', 'sensitivityInspectionTemplateIncludes_managedDataIdentifierIds' - An array of unique identifiers, one for each managed data identifier to
-- include.
--
-- Amazon Macie uses these managed data identifiers in addition to managed
-- data identifiers that are subsequently released and recommended for
-- automated sensitive data discovery. To retrieve a list of valid values
-- for the managed data identifiers that are currently available, use the
-- ListManagedDataIdentifiers operation.
newSensitivityInspectionTemplateIncludes ::
  SensitivityInspectionTemplateIncludes
newSensitivityInspectionTemplateIncludes :: SensitivityInspectionTemplateIncludes
newSensitivityInspectionTemplateIncludes =
  SensitivityInspectionTemplateIncludes'
    { $sel:allowListIds:SensitivityInspectionTemplateIncludes' :: Maybe [Text]
allowListIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:customDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: Maybe [Text]
customDataIdentifierIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:managedDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: Maybe [Text]
managedDataIdentifierIds =
        forall a. Maybe a
Prelude.Nothing
    }

-- | An array of unique identifiers, one for each allow list to include.
sensitivityInspectionTemplateIncludes_allowListIds :: Lens.Lens' SensitivityInspectionTemplateIncludes (Prelude.Maybe [Prelude.Text])
sensitivityInspectionTemplateIncludes_allowListIds :: Lens' SensitivityInspectionTemplateIncludes (Maybe [Text])
sensitivityInspectionTemplateIncludes_allowListIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitivityInspectionTemplateIncludes' {Maybe [Text]
allowListIds :: Maybe [Text]
$sel:allowListIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
allowListIds} -> Maybe [Text]
allowListIds) (\s :: SensitivityInspectionTemplateIncludes
s@SensitivityInspectionTemplateIncludes' {} Maybe [Text]
a -> SensitivityInspectionTemplateIncludes
s {$sel:allowListIds:SensitivityInspectionTemplateIncludes' :: Maybe [Text]
allowListIds = Maybe [Text]
a} :: SensitivityInspectionTemplateIncludes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of unique identifiers, one for each custom data identifier to
-- include.
sensitivityInspectionTemplateIncludes_customDataIdentifierIds :: Lens.Lens' SensitivityInspectionTemplateIncludes (Prelude.Maybe [Prelude.Text])
sensitivityInspectionTemplateIncludes_customDataIdentifierIds :: Lens' SensitivityInspectionTemplateIncludes (Maybe [Text])
sensitivityInspectionTemplateIncludes_customDataIdentifierIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitivityInspectionTemplateIncludes' {Maybe [Text]
customDataIdentifierIds :: Maybe [Text]
$sel:customDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
customDataIdentifierIds} -> Maybe [Text]
customDataIdentifierIds) (\s :: SensitivityInspectionTemplateIncludes
s@SensitivityInspectionTemplateIncludes' {} Maybe [Text]
a -> SensitivityInspectionTemplateIncludes
s {$sel:customDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: Maybe [Text]
customDataIdentifierIds = Maybe [Text]
a} :: SensitivityInspectionTemplateIncludes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of unique identifiers, one for each managed data identifier to
-- include.
--
-- Amazon Macie uses these managed data identifiers in addition to managed
-- data identifiers that are subsequently released and recommended for
-- automated sensitive data discovery. To retrieve a list of valid values
-- for the managed data identifiers that are currently available, use the
-- ListManagedDataIdentifiers operation.
sensitivityInspectionTemplateIncludes_managedDataIdentifierIds :: Lens.Lens' SensitivityInspectionTemplateIncludes (Prelude.Maybe [Prelude.Text])
sensitivityInspectionTemplateIncludes_managedDataIdentifierIds :: Lens' SensitivityInspectionTemplateIncludes (Maybe [Text])
sensitivityInspectionTemplateIncludes_managedDataIdentifierIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitivityInspectionTemplateIncludes' {Maybe [Text]
managedDataIdentifierIds :: Maybe [Text]
$sel:managedDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
managedDataIdentifierIds} -> Maybe [Text]
managedDataIdentifierIds) (\s :: SensitivityInspectionTemplateIncludes
s@SensitivityInspectionTemplateIncludes' {} Maybe [Text]
a -> SensitivityInspectionTemplateIncludes
s {$sel:managedDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: Maybe [Text]
managedDataIdentifierIds = Maybe [Text]
a} :: SensitivityInspectionTemplateIncludes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Data.FromJSON
    SensitivityInspectionTemplateIncludes
  where
  parseJSON :: Value -> Parser SensitivityInspectionTemplateIncludes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SensitivityInspectionTemplateIncludes"
      ( \Object
x ->
          Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> SensitivityInspectionTemplateIncludes
SensitivityInspectionTemplateIncludes'
            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
"allowListIds" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"customDataIdentifierIds"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"managedDataIdentifierIds"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    SensitivityInspectionTemplateIncludes
  where
  hashWithSalt :: Int -> SensitivityInspectionTemplateIncludes -> Int
hashWithSalt
    Int
_salt
    SensitivityInspectionTemplateIncludes' {Maybe [Text]
managedDataIdentifierIds :: Maybe [Text]
customDataIdentifierIds :: Maybe [Text]
allowListIds :: Maybe [Text]
$sel:managedDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
$sel:customDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
$sel:allowListIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
allowListIds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
customDataIdentifierIds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
managedDataIdentifierIds

instance
  Prelude.NFData
    SensitivityInspectionTemplateIncludes
  where
  rnf :: SensitivityInspectionTemplateIncludes -> ()
rnf SensitivityInspectionTemplateIncludes' {Maybe [Text]
managedDataIdentifierIds :: Maybe [Text]
customDataIdentifierIds :: Maybe [Text]
allowListIds :: Maybe [Text]
$sel:managedDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
$sel:customDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
$sel:allowListIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
allowListIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
customDataIdentifierIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
managedDataIdentifierIds

instance
  Data.ToJSON
    SensitivityInspectionTemplateIncludes
  where
  toJSON :: SensitivityInspectionTemplateIncludes -> Value
toJSON SensitivityInspectionTemplateIncludes' {Maybe [Text]
managedDataIdentifierIds :: Maybe [Text]
customDataIdentifierIds :: Maybe [Text]
allowListIds :: Maybe [Text]
$sel:managedDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
$sel:customDataIdentifierIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
$sel:allowListIds:SensitivityInspectionTemplateIncludes' :: SensitivityInspectionTemplateIncludes -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"allowListIds" 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]
allowListIds,
            (Key
"customDataIdentifierIds" 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]
customDataIdentifierIds,
            (Key
"managedDataIdentifierIds" 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]
managedDataIdentifierIds
          ]
      )