{-# 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.S3ClassificationScopeUpdate
-- 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.S3ClassificationScopeUpdate 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.S3ClassificationScopeExclusionUpdate
import qualified Amazonka.Prelude as Prelude

-- | Specifies changes to the list of S3 buckets that are excluded from
-- automated sensitive data discovery for an Amazon Macie account.
--
-- /See:/ 'newS3ClassificationScopeUpdate' smart constructor.
data S3ClassificationScopeUpdate = S3ClassificationScopeUpdate'
  { -- | The names of the S3 buckets to add or remove from the list.
    S3ClassificationScopeUpdate -> S3ClassificationScopeExclusionUpdate
excludes :: S3ClassificationScopeExclusionUpdate
  }
  deriving (S3ClassificationScopeUpdate -> S3ClassificationScopeUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ClassificationScopeUpdate -> S3ClassificationScopeUpdate -> Bool
$c/= :: S3ClassificationScopeUpdate -> S3ClassificationScopeUpdate -> Bool
== :: S3ClassificationScopeUpdate -> S3ClassificationScopeUpdate -> Bool
$c== :: S3ClassificationScopeUpdate -> S3ClassificationScopeUpdate -> Bool
Prelude.Eq, ReadPrec [S3ClassificationScopeUpdate]
ReadPrec S3ClassificationScopeUpdate
Int -> ReadS S3ClassificationScopeUpdate
ReadS [S3ClassificationScopeUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ClassificationScopeUpdate]
$creadListPrec :: ReadPrec [S3ClassificationScopeUpdate]
readPrec :: ReadPrec S3ClassificationScopeUpdate
$creadPrec :: ReadPrec S3ClassificationScopeUpdate
readList :: ReadS [S3ClassificationScopeUpdate]
$creadList :: ReadS [S3ClassificationScopeUpdate]
readsPrec :: Int -> ReadS S3ClassificationScopeUpdate
$creadsPrec :: Int -> ReadS S3ClassificationScopeUpdate
Prelude.Read, Int -> S3ClassificationScopeUpdate -> ShowS
[S3ClassificationScopeUpdate] -> ShowS
S3ClassificationScopeUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ClassificationScopeUpdate] -> ShowS
$cshowList :: [S3ClassificationScopeUpdate] -> ShowS
show :: S3ClassificationScopeUpdate -> String
$cshow :: S3ClassificationScopeUpdate -> String
showsPrec :: Int -> S3ClassificationScopeUpdate -> ShowS
$cshowsPrec :: Int -> S3ClassificationScopeUpdate -> ShowS
Prelude.Show, forall x.
Rep S3ClassificationScopeUpdate x -> S3ClassificationScopeUpdate
forall x.
S3ClassificationScopeUpdate -> Rep S3ClassificationScopeUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3ClassificationScopeUpdate x -> S3ClassificationScopeUpdate
$cfrom :: forall x.
S3ClassificationScopeUpdate -> Rep S3ClassificationScopeUpdate x
Prelude.Generic)

-- |
-- Create a value of 'S3ClassificationScopeUpdate' 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:
--
-- 'excludes', 's3ClassificationScopeUpdate_excludes' - The names of the S3 buckets to add or remove from the list.
newS3ClassificationScopeUpdate ::
  -- | 'excludes'
  S3ClassificationScopeExclusionUpdate ->
  S3ClassificationScopeUpdate
newS3ClassificationScopeUpdate :: S3ClassificationScopeExclusionUpdate -> S3ClassificationScopeUpdate
newS3ClassificationScopeUpdate S3ClassificationScopeExclusionUpdate
pExcludes_ =
  S3ClassificationScopeUpdate' {$sel:excludes:S3ClassificationScopeUpdate' :: S3ClassificationScopeExclusionUpdate
excludes = S3ClassificationScopeExclusionUpdate
pExcludes_}

-- | The names of the S3 buckets to add or remove from the list.
s3ClassificationScopeUpdate_excludes :: Lens.Lens' S3ClassificationScopeUpdate S3ClassificationScopeExclusionUpdate
s3ClassificationScopeUpdate_excludes :: Lens'
  S3ClassificationScopeUpdate S3ClassificationScopeExclusionUpdate
s3ClassificationScopeUpdate_excludes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ClassificationScopeUpdate' {S3ClassificationScopeExclusionUpdate
excludes :: S3ClassificationScopeExclusionUpdate
$sel:excludes:S3ClassificationScopeUpdate' :: S3ClassificationScopeUpdate -> S3ClassificationScopeExclusionUpdate
excludes} -> S3ClassificationScopeExclusionUpdate
excludes) (\s :: S3ClassificationScopeUpdate
s@S3ClassificationScopeUpdate' {} S3ClassificationScopeExclusionUpdate
a -> S3ClassificationScopeUpdate
s {$sel:excludes:S3ClassificationScopeUpdate' :: S3ClassificationScopeExclusionUpdate
excludes = S3ClassificationScopeExclusionUpdate
a} :: S3ClassificationScopeUpdate)

instance Prelude.Hashable S3ClassificationScopeUpdate where
  hashWithSalt :: Int -> S3ClassificationScopeUpdate -> Int
hashWithSalt Int
_salt S3ClassificationScopeUpdate' {S3ClassificationScopeExclusionUpdate
excludes :: S3ClassificationScopeExclusionUpdate
$sel:excludes:S3ClassificationScopeUpdate' :: S3ClassificationScopeUpdate -> S3ClassificationScopeExclusionUpdate
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3ClassificationScopeExclusionUpdate
excludes

instance Prelude.NFData S3ClassificationScopeUpdate where
  rnf :: S3ClassificationScopeUpdate -> ()
rnf S3ClassificationScopeUpdate' {S3ClassificationScopeExclusionUpdate
excludes :: S3ClassificationScopeExclusionUpdate
$sel:excludes:S3ClassificationScopeUpdate' :: S3ClassificationScopeUpdate -> S3ClassificationScopeExclusionUpdate
..} =
    forall a. NFData a => a -> ()
Prelude.rnf S3ClassificationScopeExclusionUpdate
excludes

instance Data.ToJSON S3ClassificationScopeUpdate where
  toJSON :: S3ClassificationScopeUpdate -> Value
toJSON S3ClassificationScopeUpdate' {S3ClassificationScopeExclusionUpdate
excludes :: S3ClassificationScopeExclusionUpdate
$sel:excludes:S3ClassificationScopeUpdate' :: S3ClassificationScopeUpdate -> S3ClassificationScopeExclusionUpdate
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"excludes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3ClassificationScopeExclusionUpdate
excludes)]
      )