{-# 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 #-}
module Amazonka.Macie.Types.ClassificationType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Macie.Types.S3ContinuousClassificationType
import Amazonka.Macie.Types.S3OneTimeClassificationType
import qualified Amazonka.Prelude as Prelude
data ClassificationType = ClassificationType'
{
ClassificationType -> S3OneTimeClassificationType
oneTime :: S3OneTimeClassificationType,
ClassificationType -> S3ContinuousClassificationType
continuous :: S3ContinuousClassificationType
}
deriving (ClassificationType -> ClassificationType -> Bool
(ClassificationType -> ClassificationType -> Bool)
-> (ClassificationType -> ClassificationType -> Bool)
-> Eq ClassificationType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassificationType -> ClassificationType -> Bool
$c/= :: ClassificationType -> ClassificationType -> Bool
== :: ClassificationType -> ClassificationType -> Bool
$c== :: ClassificationType -> ClassificationType -> Bool
Prelude.Eq, ReadPrec [ClassificationType]
ReadPrec ClassificationType
Int -> ReadS ClassificationType
ReadS [ClassificationType]
(Int -> ReadS ClassificationType)
-> ReadS [ClassificationType]
-> ReadPrec ClassificationType
-> ReadPrec [ClassificationType]
-> Read ClassificationType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClassificationType]
$creadListPrec :: ReadPrec [ClassificationType]
readPrec :: ReadPrec ClassificationType
$creadPrec :: ReadPrec ClassificationType
readList :: ReadS [ClassificationType]
$creadList :: ReadS [ClassificationType]
readsPrec :: Int -> ReadS ClassificationType
$creadsPrec :: Int -> ReadS ClassificationType
Prelude.Read, Int -> ClassificationType -> ShowS
[ClassificationType] -> ShowS
ClassificationType -> String
(Int -> ClassificationType -> ShowS)
-> (ClassificationType -> String)
-> ([ClassificationType] -> ShowS)
-> Show ClassificationType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassificationType] -> ShowS
$cshowList :: [ClassificationType] -> ShowS
show :: ClassificationType -> String
$cshow :: ClassificationType -> String
showsPrec :: Int -> ClassificationType -> ShowS
$cshowsPrec :: Int -> ClassificationType -> ShowS
Prelude.Show, (forall x. ClassificationType -> Rep ClassificationType x)
-> (forall x. Rep ClassificationType x -> ClassificationType)
-> Generic ClassificationType
forall x. Rep ClassificationType x -> ClassificationType
forall x. ClassificationType -> Rep ClassificationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClassificationType x -> ClassificationType
$cfrom :: forall x. ClassificationType -> Rep ClassificationType x
Prelude.Generic)
newClassificationType ::
S3OneTimeClassificationType ->
S3ContinuousClassificationType ->
ClassificationType
newClassificationType :: S3OneTimeClassificationType
-> S3ContinuousClassificationType -> ClassificationType
newClassificationType S3OneTimeClassificationType
pOneTime_ S3ContinuousClassificationType
pContinuous_ =
ClassificationType' :: S3OneTimeClassificationType
-> S3ContinuousClassificationType -> ClassificationType
ClassificationType'
{ $sel:oneTime:ClassificationType' :: S3OneTimeClassificationType
oneTime = S3OneTimeClassificationType
pOneTime_,
$sel:continuous:ClassificationType' :: S3ContinuousClassificationType
continuous = S3ContinuousClassificationType
pContinuous_
}
classificationType_oneTime :: Lens.Lens' ClassificationType S3OneTimeClassificationType
classificationType_oneTime :: (S3OneTimeClassificationType -> f S3OneTimeClassificationType)
-> ClassificationType -> f ClassificationType
classificationType_oneTime = (ClassificationType -> S3OneTimeClassificationType)
-> (ClassificationType
-> S3OneTimeClassificationType -> ClassificationType)
-> Lens
ClassificationType
ClassificationType
S3OneTimeClassificationType
S3OneTimeClassificationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationType' {S3OneTimeClassificationType
oneTime :: S3OneTimeClassificationType
$sel:oneTime:ClassificationType' :: ClassificationType -> S3OneTimeClassificationType
oneTime} -> S3OneTimeClassificationType
oneTime) (\s :: ClassificationType
s@ClassificationType' {} S3OneTimeClassificationType
a -> ClassificationType
s {$sel:oneTime:ClassificationType' :: S3OneTimeClassificationType
oneTime = S3OneTimeClassificationType
a} :: ClassificationType)
classificationType_continuous :: Lens.Lens' ClassificationType S3ContinuousClassificationType
classificationType_continuous :: (S3ContinuousClassificationType
-> f S3ContinuousClassificationType)
-> ClassificationType -> f ClassificationType
classificationType_continuous = (ClassificationType -> S3ContinuousClassificationType)
-> (ClassificationType
-> S3ContinuousClassificationType -> ClassificationType)
-> Lens
ClassificationType
ClassificationType
S3ContinuousClassificationType
S3ContinuousClassificationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationType' {S3ContinuousClassificationType
continuous :: S3ContinuousClassificationType
$sel:continuous:ClassificationType' :: ClassificationType -> S3ContinuousClassificationType
continuous} -> S3ContinuousClassificationType
continuous) (\s :: ClassificationType
s@ClassificationType' {} S3ContinuousClassificationType
a -> ClassificationType
s {$sel:continuous:ClassificationType' :: S3ContinuousClassificationType
continuous = S3ContinuousClassificationType
a} :: ClassificationType)
instance Core.FromJSON ClassificationType where
parseJSON :: Value -> Parser ClassificationType
parseJSON =
String
-> (Object -> Parser ClassificationType)
-> Value
-> Parser ClassificationType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClassificationType"
( \Object
x ->
S3OneTimeClassificationType
-> S3ContinuousClassificationType -> ClassificationType
ClassificationType'
(S3OneTimeClassificationType
-> S3ContinuousClassificationType -> ClassificationType)
-> Parser S3OneTimeClassificationType
-> Parser (S3ContinuousClassificationType -> ClassificationType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser S3OneTimeClassificationType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"oneTime")
Parser (S3ContinuousClassificationType -> ClassificationType)
-> Parser S3ContinuousClassificationType
-> Parser ClassificationType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser S3ContinuousClassificationType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"continuous")
)
instance Prelude.Hashable ClassificationType
instance Prelude.NFData ClassificationType
instance Core.ToJSON ClassificationType where
toJSON :: ClassificationType -> Value
toJSON ClassificationType' {S3ContinuousClassificationType
S3OneTimeClassificationType
continuous :: S3ContinuousClassificationType
oneTime :: S3OneTimeClassificationType
$sel:continuous:ClassificationType' :: ClassificationType -> S3ContinuousClassificationType
$sel:oneTime:ClassificationType' :: ClassificationType -> S3OneTimeClassificationType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"oneTime" Text -> S3OneTimeClassificationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3OneTimeClassificationType
oneTime),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"continuous" Text -> S3ContinuousClassificationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3ContinuousClassificationType
continuous)
]
)