{-# 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.Macie.Types.S3ResourceClassificationUpdate
-- 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.Macie.Types.S3ResourceClassificationUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Macie.Types.ClassificationTypeUpdate
import qualified Amazonka.Prelude as Prelude

-- | The S3 resources whose classification types you want to update. This
-- data type is used as a request parameter in the UpdateS3Resources
-- action.
--
-- /See:/ 'newS3ResourceClassificationUpdate' smart constructor.
data S3ResourceClassificationUpdate = S3ResourceClassificationUpdate'
  { -- | The prefix of the S3 bucket whose classification types you want to
    -- update.
    S3ResourceClassificationUpdate -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
    -- | The name of the S3 bucket whose classification types you want to update.
    S3ResourceClassificationUpdate -> Text
bucketName :: Prelude.Text,
    -- | The classification type that you want to update for the resource
    -- associated with Amazon Macie Classic.
    S3ResourceClassificationUpdate -> ClassificationTypeUpdate
classificationTypeUpdate :: ClassificationTypeUpdate
  }
  deriving (S3ResourceClassificationUpdate
-> S3ResourceClassificationUpdate -> Bool
(S3ResourceClassificationUpdate
 -> S3ResourceClassificationUpdate -> Bool)
-> (S3ResourceClassificationUpdate
    -> S3ResourceClassificationUpdate -> Bool)
-> Eq S3ResourceClassificationUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ResourceClassificationUpdate
-> S3ResourceClassificationUpdate -> Bool
$c/= :: S3ResourceClassificationUpdate
-> S3ResourceClassificationUpdate -> Bool
== :: S3ResourceClassificationUpdate
-> S3ResourceClassificationUpdate -> Bool
$c== :: S3ResourceClassificationUpdate
-> S3ResourceClassificationUpdate -> Bool
Prelude.Eq, ReadPrec [S3ResourceClassificationUpdate]
ReadPrec S3ResourceClassificationUpdate
Int -> ReadS S3ResourceClassificationUpdate
ReadS [S3ResourceClassificationUpdate]
(Int -> ReadS S3ResourceClassificationUpdate)
-> ReadS [S3ResourceClassificationUpdate]
-> ReadPrec S3ResourceClassificationUpdate
-> ReadPrec [S3ResourceClassificationUpdate]
-> Read S3ResourceClassificationUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ResourceClassificationUpdate]
$creadListPrec :: ReadPrec [S3ResourceClassificationUpdate]
readPrec :: ReadPrec S3ResourceClassificationUpdate
$creadPrec :: ReadPrec S3ResourceClassificationUpdate
readList :: ReadS [S3ResourceClassificationUpdate]
$creadList :: ReadS [S3ResourceClassificationUpdate]
readsPrec :: Int -> ReadS S3ResourceClassificationUpdate
$creadsPrec :: Int -> ReadS S3ResourceClassificationUpdate
Prelude.Read, Int -> S3ResourceClassificationUpdate -> ShowS
[S3ResourceClassificationUpdate] -> ShowS
S3ResourceClassificationUpdate -> String
(Int -> S3ResourceClassificationUpdate -> ShowS)
-> (S3ResourceClassificationUpdate -> String)
-> ([S3ResourceClassificationUpdate] -> ShowS)
-> Show S3ResourceClassificationUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ResourceClassificationUpdate] -> ShowS
$cshowList :: [S3ResourceClassificationUpdate] -> ShowS
show :: S3ResourceClassificationUpdate -> String
$cshow :: S3ResourceClassificationUpdate -> String
showsPrec :: Int -> S3ResourceClassificationUpdate -> ShowS
$cshowsPrec :: Int -> S3ResourceClassificationUpdate -> ShowS
Prelude.Show, (forall x.
 S3ResourceClassificationUpdate
 -> Rep S3ResourceClassificationUpdate x)
-> (forall x.
    Rep S3ResourceClassificationUpdate x
    -> S3ResourceClassificationUpdate)
-> Generic S3ResourceClassificationUpdate
forall x.
Rep S3ResourceClassificationUpdate x
-> S3ResourceClassificationUpdate
forall x.
S3ResourceClassificationUpdate
-> Rep S3ResourceClassificationUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3ResourceClassificationUpdate x
-> S3ResourceClassificationUpdate
$cfrom :: forall x.
S3ResourceClassificationUpdate
-> Rep S3ResourceClassificationUpdate x
Prelude.Generic)

-- |
-- Create a value of 'S3ResourceClassificationUpdate' 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:
--
-- 'prefix', 's3ResourceClassificationUpdate_prefix' - The prefix of the S3 bucket whose classification types you want to
-- update.
--
-- 'bucketName', 's3ResourceClassificationUpdate_bucketName' - The name of the S3 bucket whose classification types you want to update.
--
-- 'classificationTypeUpdate', 's3ResourceClassificationUpdate_classificationTypeUpdate' - The classification type that you want to update for the resource
-- associated with Amazon Macie Classic.
newS3ResourceClassificationUpdate ::
  -- | 'bucketName'
  Prelude.Text ->
  -- | 'classificationTypeUpdate'
  ClassificationTypeUpdate ->
  S3ResourceClassificationUpdate
newS3ResourceClassificationUpdate :: Text -> ClassificationTypeUpdate -> S3ResourceClassificationUpdate
newS3ResourceClassificationUpdate
  Text
pBucketName_
  ClassificationTypeUpdate
pClassificationTypeUpdate_ =
    S3ResourceClassificationUpdate' :: Maybe Text
-> Text
-> ClassificationTypeUpdate
-> S3ResourceClassificationUpdate
S3ResourceClassificationUpdate'
      { $sel:prefix:S3ResourceClassificationUpdate' :: Maybe Text
prefix =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:bucketName:S3ResourceClassificationUpdate' :: Text
bucketName = Text
pBucketName_,
        $sel:classificationTypeUpdate:S3ResourceClassificationUpdate' :: ClassificationTypeUpdate
classificationTypeUpdate =
          ClassificationTypeUpdate
pClassificationTypeUpdate_
      }

-- | The prefix of the S3 bucket whose classification types you want to
-- update.
s3ResourceClassificationUpdate_prefix :: Lens.Lens' S3ResourceClassificationUpdate (Prelude.Maybe Prelude.Text)
s3ResourceClassificationUpdate_prefix :: (Maybe Text -> f (Maybe Text))
-> S3ResourceClassificationUpdate
-> f S3ResourceClassificationUpdate
s3ResourceClassificationUpdate_prefix = (S3ResourceClassificationUpdate -> Maybe Text)
-> (S3ResourceClassificationUpdate
    -> Maybe Text -> S3ResourceClassificationUpdate)
-> Lens
     S3ResourceClassificationUpdate
     S3ResourceClassificationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ResourceClassificationUpdate' {Maybe Text
prefix :: Maybe Text
$sel:prefix:S3ResourceClassificationUpdate' :: S3ResourceClassificationUpdate -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: S3ResourceClassificationUpdate
s@S3ResourceClassificationUpdate' {} Maybe Text
a -> S3ResourceClassificationUpdate
s {$sel:prefix:S3ResourceClassificationUpdate' :: Maybe Text
prefix = Maybe Text
a} :: S3ResourceClassificationUpdate)

-- | The name of the S3 bucket whose classification types you want to update.
s3ResourceClassificationUpdate_bucketName :: Lens.Lens' S3ResourceClassificationUpdate Prelude.Text
s3ResourceClassificationUpdate_bucketName :: (Text -> f Text)
-> S3ResourceClassificationUpdate
-> f S3ResourceClassificationUpdate
s3ResourceClassificationUpdate_bucketName = (S3ResourceClassificationUpdate -> Text)
-> (S3ResourceClassificationUpdate
    -> Text -> S3ResourceClassificationUpdate)
-> Lens
     S3ResourceClassificationUpdate
     S3ResourceClassificationUpdate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ResourceClassificationUpdate' {Text
bucketName :: Text
$sel:bucketName:S3ResourceClassificationUpdate' :: S3ResourceClassificationUpdate -> Text
bucketName} -> Text
bucketName) (\s :: S3ResourceClassificationUpdate
s@S3ResourceClassificationUpdate' {} Text
a -> S3ResourceClassificationUpdate
s {$sel:bucketName:S3ResourceClassificationUpdate' :: Text
bucketName = Text
a} :: S3ResourceClassificationUpdate)

-- | The classification type that you want to update for the resource
-- associated with Amazon Macie Classic.
s3ResourceClassificationUpdate_classificationTypeUpdate :: Lens.Lens' S3ResourceClassificationUpdate ClassificationTypeUpdate
s3ResourceClassificationUpdate_classificationTypeUpdate :: (ClassificationTypeUpdate -> f ClassificationTypeUpdate)
-> S3ResourceClassificationUpdate
-> f S3ResourceClassificationUpdate
s3ResourceClassificationUpdate_classificationTypeUpdate = (S3ResourceClassificationUpdate -> ClassificationTypeUpdate)
-> (S3ResourceClassificationUpdate
    -> ClassificationTypeUpdate -> S3ResourceClassificationUpdate)
-> Lens
     S3ResourceClassificationUpdate
     S3ResourceClassificationUpdate
     ClassificationTypeUpdate
     ClassificationTypeUpdate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ResourceClassificationUpdate' {ClassificationTypeUpdate
classificationTypeUpdate :: ClassificationTypeUpdate
$sel:classificationTypeUpdate:S3ResourceClassificationUpdate' :: S3ResourceClassificationUpdate -> ClassificationTypeUpdate
classificationTypeUpdate} -> ClassificationTypeUpdate
classificationTypeUpdate) (\s :: S3ResourceClassificationUpdate
s@S3ResourceClassificationUpdate' {} ClassificationTypeUpdate
a -> S3ResourceClassificationUpdate
s {$sel:classificationTypeUpdate:S3ResourceClassificationUpdate' :: ClassificationTypeUpdate
classificationTypeUpdate = ClassificationTypeUpdate
a} :: S3ResourceClassificationUpdate)

instance
  Prelude.Hashable
    S3ResourceClassificationUpdate

instance
  Prelude.NFData
    S3ResourceClassificationUpdate

instance Core.ToJSON S3ResourceClassificationUpdate where
  toJSON :: S3ResourceClassificationUpdate -> Value
toJSON S3ResourceClassificationUpdate' {Maybe Text
Text
ClassificationTypeUpdate
classificationTypeUpdate :: ClassificationTypeUpdate
bucketName :: Text
prefix :: Maybe Text
$sel:classificationTypeUpdate:S3ResourceClassificationUpdate' :: S3ResourceClassificationUpdate -> ClassificationTypeUpdate
$sel:bucketName:S3ResourceClassificationUpdate' :: S3ResourceClassificationUpdate -> Text
$sel:prefix:S3ResourceClassificationUpdate' :: S3ResourceClassificationUpdate -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"prefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
prefix,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"bucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucketName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"classificationTypeUpdate"
                  Text -> ClassificationTypeUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ClassificationTypeUpdate
classificationTypeUpdate
              )
          ]
      )