{-# 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.S3ClassificationScopeExclusion
-- 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.S3ClassificationScopeExclusion 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 names of the S3 buckets that are excluded from automated
-- sensitive data discovery.
--
-- /See:/ 'newS3ClassificationScopeExclusion' smart constructor.
data S3ClassificationScopeExclusion = S3ClassificationScopeExclusion'
  { -- | An array of strings, one for each S3 bucket that is excluded. Each
    -- string is the full name of an excluded bucket.
    S3ClassificationScopeExclusion -> [Text]
bucketNames :: [Prelude.Text]
  }
  deriving (S3ClassificationScopeExclusion
-> S3ClassificationScopeExclusion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ClassificationScopeExclusion
-> S3ClassificationScopeExclusion -> Bool
$c/= :: S3ClassificationScopeExclusion
-> S3ClassificationScopeExclusion -> Bool
== :: S3ClassificationScopeExclusion
-> S3ClassificationScopeExclusion -> Bool
$c== :: S3ClassificationScopeExclusion
-> S3ClassificationScopeExclusion -> Bool
Prelude.Eq, ReadPrec [S3ClassificationScopeExclusion]
ReadPrec S3ClassificationScopeExclusion
Int -> ReadS S3ClassificationScopeExclusion
ReadS [S3ClassificationScopeExclusion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ClassificationScopeExclusion]
$creadListPrec :: ReadPrec [S3ClassificationScopeExclusion]
readPrec :: ReadPrec S3ClassificationScopeExclusion
$creadPrec :: ReadPrec S3ClassificationScopeExclusion
readList :: ReadS [S3ClassificationScopeExclusion]
$creadList :: ReadS [S3ClassificationScopeExclusion]
readsPrec :: Int -> ReadS S3ClassificationScopeExclusion
$creadsPrec :: Int -> ReadS S3ClassificationScopeExclusion
Prelude.Read, Int -> S3ClassificationScopeExclusion -> ShowS
[S3ClassificationScopeExclusion] -> ShowS
S3ClassificationScopeExclusion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ClassificationScopeExclusion] -> ShowS
$cshowList :: [S3ClassificationScopeExclusion] -> ShowS
show :: S3ClassificationScopeExclusion -> String
$cshow :: S3ClassificationScopeExclusion -> String
showsPrec :: Int -> S3ClassificationScopeExclusion -> ShowS
$cshowsPrec :: Int -> S3ClassificationScopeExclusion -> ShowS
Prelude.Show, forall x.
Rep S3ClassificationScopeExclusion x
-> S3ClassificationScopeExclusion
forall x.
S3ClassificationScopeExclusion
-> Rep S3ClassificationScopeExclusion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3ClassificationScopeExclusion x
-> S3ClassificationScopeExclusion
$cfrom :: forall x.
S3ClassificationScopeExclusion
-> Rep S3ClassificationScopeExclusion x
Prelude.Generic)

-- |
-- Create a value of 'S3ClassificationScopeExclusion' 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:
--
-- 'bucketNames', 's3ClassificationScopeExclusion_bucketNames' - An array of strings, one for each S3 bucket that is excluded. Each
-- string is the full name of an excluded bucket.
newS3ClassificationScopeExclusion ::
  S3ClassificationScopeExclusion
newS3ClassificationScopeExclusion :: S3ClassificationScopeExclusion
newS3ClassificationScopeExclusion =
  S3ClassificationScopeExclusion'
    { $sel:bucketNames:S3ClassificationScopeExclusion' :: [Text]
bucketNames =
        forall a. Monoid a => a
Prelude.mempty
    }

-- | An array of strings, one for each S3 bucket that is excluded. Each
-- string is the full name of an excluded bucket.
s3ClassificationScopeExclusion_bucketNames :: Lens.Lens' S3ClassificationScopeExclusion [Prelude.Text]
s3ClassificationScopeExclusion_bucketNames :: Lens' S3ClassificationScopeExclusion [Text]
s3ClassificationScopeExclusion_bucketNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ClassificationScopeExclusion' {[Text]
bucketNames :: [Text]
$sel:bucketNames:S3ClassificationScopeExclusion' :: S3ClassificationScopeExclusion -> [Text]
bucketNames} -> [Text]
bucketNames) (\s :: S3ClassificationScopeExclusion
s@S3ClassificationScopeExclusion' {} [Text]
a -> S3ClassificationScopeExclusion
s {$sel:bucketNames:S3ClassificationScopeExclusion' :: [Text]
bucketNames = [Text]
a} :: S3ClassificationScopeExclusion) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON S3ClassificationScopeExclusion where
  parseJSON :: Value -> Parser S3ClassificationScopeExclusion
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"S3ClassificationScopeExclusion"
      ( \Object
x ->
          [Text] -> S3ClassificationScopeExclusion
S3ClassificationScopeExclusion'
            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
"bucketNames" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    S3ClassificationScopeExclusion
  where
  hashWithSalt :: Int -> S3ClassificationScopeExclusion -> Int
hashWithSalt
    Int
_salt
    S3ClassificationScopeExclusion' {[Text]
bucketNames :: [Text]
$sel:bucketNames:S3ClassificationScopeExclusion' :: S3ClassificationScopeExclusion -> [Text]
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
bucketNames

instance
  Prelude.NFData
    S3ClassificationScopeExclusion
  where
  rnf :: S3ClassificationScopeExclusion -> ()
rnf S3ClassificationScopeExclusion' {[Text]
bucketNames :: [Text]
$sel:bucketNames:S3ClassificationScopeExclusion' :: S3ClassificationScopeExclusion -> [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf [Text]
bucketNames