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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Macie.Types.S3ContinuousClassificationType
import Amazonka.Macie.Types.S3OneTimeClassificationType
import qualified Amazonka.Prelude as Prelude

-- | (Discontinued) The classification type that Amazon Macie Classic applies
-- to the associated S3 resources. At least one of the classification types
-- (@oneTime@ or @continuous@) must be specified.
--
-- /See:/ 'newClassificationTypeUpdate' smart constructor.
data ClassificationTypeUpdate = ClassificationTypeUpdate'
  { -- | (Discontinued) A continuous classification of the objects that are added
    -- to a specified S3 bucket. Amazon Macie Classic begins performing
    -- continuous classification after a bucket is successfully associated with
    -- Macie Classic.
    ClassificationTypeUpdate -> Maybe S3ContinuousClassificationType
continuous :: Prelude.Maybe S3ContinuousClassificationType,
    -- | (Discontinued) A one-time classification of all of the existing objects
    -- in a specified S3 bucket.
    ClassificationTypeUpdate -> Maybe S3OneTimeClassificationType
oneTime :: Prelude.Maybe S3OneTimeClassificationType
  }
  deriving (ClassificationTypeUpdate -> ClassificationTypeUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassificationTypeUpdate -> ClassificationTypeUpdate -> Bool
$c/= :: ClassificationTypeUpdate -> ClassificationTypeUpdate -> Bool
== :: ClassificationTypeUpdate -> ClassificationTypeUpdate -> Bool
$c== :: ClassificationTypeUpdate -> ClassificationTypeUpdate -> Bool
Prelude.Eq, ReadPrec [ClassificationTypeUpdate]
ReadPrec ClassificationTypeUpdate
Int -> ReadS ClassificationTypeUpdate
ReadS [ClassificationTypeUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClassificationTypeUpdate]
$creadListPrec :: ReadPrec [ClassificationTypeUpdate]
readPrec :: ReadPrec ClassificationTypeUpdate
$creadPrec :: ReadPrec ClassificationTypeUpdate
readList :: ReadS [ClassificationTypeUpdate]
$creadList :: ReadS [ClassificationTypeUpdate]
readsPrec :: Int -> ReadS ClassificationTypeUpdate
$creadsPrec :: Int -> ReadS ClassificationTypeUpdate
Prelude.Read, Int -> ClassificationTypeUpdate -> ShowS
[ClassificationTypeUpdate] -> ShowS
ClassificationTypeUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassificationTypeUpdate] -> ShowS
$cshowList :: [ClassificationTypeUpdate] -> ShowS
show :: ClassificationTypeUpdate -> String
$cshow :: ClassificationTypeUpdate -> String
showsPrec :: Int -> ClassificationTypeUpdate -> ShowS
$cshowsPrec :: Int -> ClassificationTypeUpdate -> ShowS
Prelude.Show, forall x.
Rep ClassificationTypeUpdate x -> ClassificationTypeUpdate
forall x.
ClassificationTypeUpdate -> Rep ClassificationTypeUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClassificationTypeUpdate x -> ClassificationTypeUpdate
$cfrom :: forall x.
ClassificationTypeUpdate -> Rep ClassificationTypeUpdate x
Prelude.Generic)

-- |
-- Create a value of 'ClassificationTypeUpdate' 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:
--
-- 'continuous', 'classificationTypeUpdate_continuous' - (Discontinued) A continuous classification of the objects that are added
-- to a specified S3 bucket. Amazon Macie Classic begins performing
-- continuous classification after a bucket is successfully associated with
-- Macie Classic.
--
-- 'oneTime', 'classificationTypeUpdate_oneTime' - (Discontinued) A one-time classification of all of the existing objects
-- in a specified S3 bucket.
newClassificationTypeUpdate ::
  ClassificationTypeUpdate
newClassificationTypeUpdate :: ClassificationTypeUpdate
newClassificationTypeUpdate =
  ClassificationTypeUpdate'
    { $sel:continuous:ClassificationTypeUpdate' :: Maybe S3ContinuousClassificationType
continuous =
        forall a. Maybe a
Prelude.Nothing,
      $sel:oneTime:ClassificationTypeUpdate' :: Maybe S3OneTimeClassificationType
oneTime = forall a. Maybe a
Prelude.Nothing
    }

-- | (Discontinued) A continuous classification of the objects that are added
-- to a specified S3 bucket. Amazon Macie Classic begins performing
-- continuous classification after a bucket is successfully associated with
-- Macie Classic.
classificationTypeUpdate_continuous :: Lens.Lens' ClassificationTypeUpdate (Prelude.Maybe S3ContinuousClassificationType)
classificationTypeUpdate_continuous :: Lens'
  ClassificationTypeUpdate (Maybe S3ContinuousClassificationType)
classificationTypeUpdate_continuous = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationTypeUpdate' {Maybe S3ContinuousClassificationType
continuous :: Maybe S3ContinuousClassificationType
$sel:continuous:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3ContinuousClassificationType
continuous} -> Maybe S3ContinuousClassificationType
continuous) (\s :: ClassificationTypeUpdate
s@ClassificationTypeUpdate' {} Maybe S3ContinuousClassificationType
a -> ClassificationTypeUpdate
s {$sel:continuous:ClassificationTypeUpdate' :: Maybe S3ContinuousClassificationType
continuous = Maybe S3ContinuousClassificationType
a} :: ClassificationTypeUpdate)

-- | (Discontinued) A one-time classification of all of the existing objects
-- in a specified S3 bucket.
classificationTypeUpdate_oneTime :: Lens.Lens' ClassificationTypeUpdate (Prelude.Maybe S3OneTimeClassificationType)
classificationTypeUpdate_oneTime :: Lens' ClassificationTypeUpdate (Maybe S3OneTimeClassificationType)
classificationTypeUpdate_oneTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationTypeUpdate' {Maybe S3OneTimeClassificationType
oneTime :: Maybe S3OneTimeClassificationType
$sel:oneTime:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3OneTimeClassificationType
oneTime} -> Maybe S3OneTimeClassificationType
oneTime) (\s :: ClassificationTypeUpdate
s@ClassificationTypeUpdate' {} Maybe S3OneTimeClassificationType
a -> ClassificationTypeUpdate
s {$sel:oneTime:ClassificationTypeUpdate' :: Maybe S3OneTimeClassificationType
oneTime = Maybe S3OneTimeClassificationType
a} :: ClassificationTypeUpdate)

instance Prelude.Hashable ClassificationTypeUpdate where
  hashWithSalt :: Int -> ClassificationTypeUpdate -> Int
hashWithSalt Int
_salt ClassificationTypeUpdate' {Maybe S3ContinuousClassificationType
Maybe S3OneTimeClassificationType
oneTime :: Maybe S3OneTimeClassificationType
continuous :: Maybe S3ContinuousClassificationType
$sel:oneTime:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3OneTimeClassificationType
$sel:continuous:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3ContinuousClassificationType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3ContinuousClassificationType
continuous
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3OneTimeClassificationType
oneTime

instance Prelude.NFData ClassificationTypeUpdate where
  rnf :: ClassificationTypeUpdate -> ()
rnf ClassificationTypeUpdate' {Maybe S3ContinuousClassificationType
Maybe S3OneTimeClassificationType
oneTime :: Maybe S3OneTimeClassificationType
continuous :: Maybe S3ContinuousClassificationType
$sel:oneTime:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3OneTimeClassificationType
$sel:continuous:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3ContinuousClassificationType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe S3ContinuousClassificationType
continuous
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3OneTimeClassificationType
oneTime

instance Data.ToJSON ClassificationTypeUpdate where
  toJSON :: ClassificationTypeUpdate -> Value
toJSON ClassificationTypeUpdate' {Maybe S3ContinuousClassificationType
Maybe S3OneTimeClassificationType
oneTime :: Maybe S3OneTimeClassificationType
continuous :: Maybe S3ContinuousClassificationType
$sel:oneTime:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3OneTimeClassificationType
$sel:continuous:ClassificationTypeUpdate' :: ClassificationTypeUpdate -> Maybe S3ContinuousClassificationType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"continuous" 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 S3ContinuousClassificationType
continuous,
            (Key
"oneTime" 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 S3OneTimeClassificationType
oneTime
          ]
      )