{-# 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.Glue.Types.PIIDetection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.PiiType
import qualified Amazonka.Prelude as Prelude
data PIIDetection = PIIDetection'
{
PIIDetection -> Maybe Text
maskValue :: Prelude.Maybe Prelude.Text,
PIIDetection -> Maybe Text
outputColumnName :: Prelude.Maybe Prelude.Text,
PIIDetection -> Maybe Double
sampleFraction :: Prelude.Maybe Prelude.Double,
PIIDetection -> Maybe Double
thresholdFraction :: Prelude.Maybe Prelude.Double,
PIIDetection -> Text
name :: Prelude.Text,
PIIDetection -> NonEmpty Text
inputs :: Prelude.NonEmpty Prelude.Text,
PIIDetection -> PiiType
piiType :: PiiType,
PIIDetection -> [Text]
entityTypesToDetect :: [Prelude.Text]
}
deriving (PIIDetection -> PIIDetection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PIIDetection -> PIIDetection -> Bool
$c/= :: PIIDetection -> PIIDetection -> Bool
== :: PIIDetection -> PIIDetection -> Bool
$c== :: PIIDetection -> PIIDetection -> Bool
Prelude.Eq, ReadPrec [PIIDetection]
ReadPrec PIIDetection
Int -> ReadS PIIDetection
ReadS [PIIDetection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PIIDetection]
$creadListPrec :: ReadPrec [PIIDetection]
readPrec :: ReadPrec PIIDetection
$creadPrec :: ReadPrec PIIDetection
readList :: ReadS [PIIDetection]
$creadList :: ReadS [PIIDetection]
readsPrec :: Int -> ReadS PIIDetection
$creadsPrec :: Int -> ReadS PIIDetection
Prelude.Read, Int -> PIIDetection -> ShowS
[PIIDetection] -> ShowS
PIIDetection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PIIDetection] -> ShowS
$cshowList :: [PIIDetection] -> ShowS
show :: PIIDetection -> String
$cshow :: PIIDetection -> String
showsPrec :: Int -> PIIDetection -> ShowS
$cshowsPrec :: Int -> PIIDetection -> ShowS
Prelude.Show, forall x. Rep PIIDetection x -> PIIDetection
forall x. PIIDetection -> Rep PIIDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PIIDetection x -> PIIDetection
$cfrom :: forall x. PIIDetection -> Rep PIIDetection x
Prelude.Generic)
newPIIDetection ::
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
PiiType ->
PIIDetection
newPIIDetection :: Text -> NonEmpty Text -> PiiType -> PIIDetection
newPIIDetection Text
pName_ NonEmpty Text
pInputs_ PiiType
pPiiType_ =
PIIDetection'
{ $sel:maskValue:PIIDetection' :: Maybe Text
maskValue = forall a. Maybe a
Prelude.Nothing,
$sel:outputColumnName:PIIDetection' :: Maybe Text
outputColumnName = forall a. Maybe a
Prelude.Nothing,
$sel:sampleFraction:PIIDetection' :: Maybe Double
sampleFraction = forall a. Maybe a
Prelude.Nothing,
$sel:thresholdFraction:PIIDetection' :: Maybe Double
thresholdFraction = forall a. Maybe a
Prelude.Nothing,
$sel:name:PIIDetection' :: Text
name = Text
pName_,
$sel:inputs:PIIDetection' :: NonEmpty Text
inputs = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pInputs_,
$sel:piiType:PIIDetection' :: PiiType
piiType = PiiType
pPiiType_,
$sel:entityTypesToDetect:PIIDetection' :: [Text]
entityTypesToDetect = forall a. Monoid a => a
Prelude.mempty
}
pIIDetection_maskValue :: Lens.Lens' PIIDetection (Prelude.Maybe Prelude.Text)
pIIDetection_maskValue :: Lens' PIIDetection (Maybe Text)
pIIDetection_maskValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {Maybe Text
maskValue :: Maybe Text
$sel:maskValue:PIIDetection' :: PIIDetection -> Maybe Text
maskValue} -> Maybe Text
maskValue) (\s :: PIIDetection
s@PIIDetection' {} Maybe Text
a -> PIIDetection
s {$sel:maskValue:PIIDetection' :: Maybe Text
maskValue = Maybe Text
a} :: PIIDetection)
pIIDetection_outputColumnName :: Lens.Lens' PIIDetection (Prelude.Maybe Prelude.Text)
pIIDetection_outputColumnName :: Lens' PIIDetection (Maybe Text)
pIIDetection_outputColumnName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {Maybe Text
outputColumnName :: Maybe Text
$sel:outputColumnName:PIIDetection' :: PIIDetection -> Maybe Text
outputColumnName} -> Maybe Text
outputColumnName) (\s :: PIIDetection
s@PIIDetection' {} Maybe Text
a -> PIIDetection
s {$sel:outputColumnName:PIIDetection' :: Maybe Text
outputColumnName = Maybe Text
a} :: PIIDetection)
pIIDetection_sampleFraction :: Lens.Lens' PIIDetection (Prelude.Maybe Prelude.Double)
pIIDetection_sampleFraction :: Lens' PIIDetection (Maybe Double)
pIIDetection_sampleFraction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {Maybe Double
sampleFraction :: Maybe Double
$sel:sampleFraction:PIIDetection' :: PIIDetection -> Maybe Double
sampleFraction} -> Maybe Double
sampleFraction) (\s :: PIIDetection
s@PIIDetection' {} Maybe Double
a -> PIIDetection
s {$sel:sampleFraction:PIIDetection' :: Maybe Double
sampleFraction = Maybe Double
a} :: PIIDetection)
pIIDetection_thresholdFraction :: Lens.Lens' PIIDetection (Prelude.Maybe Prelude.Double)
pIIDetection_thresholdFraction :: Lens' PIIDetection (Maybe Double)
pIIDetection_thresholdFraction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {Maybe Double
thresholdFraction :: Maybe Double
$sel:thresholdFraction:PIIDetection' :: PIIDetection -> Maybe Double
thresholdFraction} -> Maybe Double
thresholdFraction) (\s :: PIIDetection
s@PIIDetection' {} Maybe Double
a -> PIIDetection
s {$sel:thresholdFraction:PIIDetection' :: Maybe Double
thresholdFraction = Maybe Double
a} :: PIIDetection)
pIIDetection_name :: Lens.Lens' PIIDetection Prelude.Text
pIIDetection_name :: Lens' PIIDetection Text
pIIDetection_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {Text
name :: Text
$sel:name:PIIDetection' :: PIIDetection -> Text
name} -> Text
name) (\s :: PIIDetection
s@PIIDetection' {} Text
a -> PIIDetection
s {$sel:name:PIIDetection' :: Text
name = Text
a} :: PIIDetection)
pIIDetection_inputs :: Lens.Lens' PIIDetection (Prelude.NonEmpty Prelude.Text)
pIIDetection_inputs :: Lens' PIIDetection (NonEmpty Text)
pIIDetection_inputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {NonEmpty Text
inputs :: NonEmpty Text
$sel:inputs:PIIDetection' :: PIIDetection -> NonEmpty Text
inputs} -> NonEmpty Text
inputs) (\s :: PIIDetection
s@PIIDetection' {} NonEmpty Text
a -> PIIDetection
s {$sel:inputs:PIIDetection' :: NonEmpty Text
inputs = NonEmpty Text
a} :: PIIDetection) 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
pIIDetection_piiType :: Lens.Lens' PIIDetection PiiType
pIIDetection_piiType :: Lens' PIIDetection PiiType
pIIDetection_piiType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {PiiType
piiType :: PiiType
$sel:piiType:PIIDetection' :: PIIDetection -> PiiType
piiType} -> PiiType
piiType) (\s :: PIIDetection
s@PIIDetection' {} PiiType
a -> PIIDetection
s {$sel:piiType:PIIDetection' :: PiiType
piiType = PiiType
a} :: PIIDetection)
pIIDetection_entityTypesToDetect :: Lens.Lens' PIIDetection [Prelude.Text]
pIIDetection_entityTypesToDetect :: Lens' PIIDetection [Text]
pIIDetection_entityTypesToDetect = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PIIDetection' {[Text]
entityTypesToDetect :: [Text]
$sel:entityTypesToDetect:PIIDetection' :: PIIDetection -> [Text]
entityTypesToDetect} -> [Text]
entityTypesToDetect) (\s :: PIIDetection
s@PIIDetection' {} [Text]
a -> PIIDetection
s {$sel:entityTypesToDetect:PIIDetection' :: [Text]
entityTypesToDetect = [Text]
a} :: PIIDetection) 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 PIIDetection where
parseJSON :: Value -> Parser PIIDetection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PIIDetection"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Text
-> NonEmpty Text
-> PiiType
-> [Text]
-> PIIDetection
PIIDetection'
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
"MaskValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OutputColumnName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SampleFraction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ThresholdFraction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Inputs")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PiiType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EntityTypesToDetect"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable PIIDetection where
hashWithSalt :: Int -> PIIDetection -> Int
hashWithSalt Int
_salt PIIDetection' {[Text]
Maybe Double
Maybe Text
NonEmpty Text
Text
PiiType
entityTypesToDetect :: [Text]
piiType :: PiiType
inputs :: NonEmpty Text
name :: Text
thresholdFraction :: Maybe Double
sampleFraction :: Maybe Double
outputColumnName :: Maybe Text
maskValue :: Maybe Text
$sel:entityTypesToDetect:PIIDetection' :: PIIDetection -> [Text]
$sel:piiType:PIIDetection' :: PIIDetection -> PiiType
$sel:inputs:PIIDetection' :: PIIDetection -> NonEmpty Text
$sel:name:PIIDetection' :: PIIDetection -> Text
$sel:thresholdFraction:PIIDetection' :: PIIDetection -> Maybe Double
$sel:sampleFraction:PIIDetection' :: PIIDetection -> Maybe Double
$sel:outputColumnName:PIIDetection' :: PIIDetection -> Maybe Text
$sel:maskValue:PIIDetection' :: PIIDetection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maskValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputColumnName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
sampleFraction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
thresholdFraction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
inputs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PiiType
piiType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
entityTypesToDetect
instance Prelude.NFData PIIDetection where
rnf :: PIIDetection -> ()
rnf PIIDetection' {[Text]
Maybe Double
Maybe Text
NonEmpty Text
Text
PiiType
entityTypesToDetect :: [Text]
piiType :: PiiType
inputs :: NonEmpty Text
name :: Text
thresholdFraction :: Maybe Double
sampleFraction :: Maybe Double
outputColumnName :: Maybe Text
maskValue :: Maybe Text
$sel:entityTypesToDetect:PIIDetection' :: PIIDetection -> [Text]
$sel:piiType:PIIDetection' :: PIIDetection -> PiiType
$sel:inputs:PIIDetection' :: PIIDetection -> NonEmpty Text
$sel:name:PIIDetection' :: PIIDetection -> Text
$sel:thresholdFraction:PIIDetection' :: PIIDetection -> Maybe Double
$sel:sampleFraction:PIIDetection' :: PIIDetection -> Maybe Double
$sel:outputColumnName:PIIDetection' :: PIIDetection -> Maybe Text
$sel:maskValue:PIIDetection' :: PIIDetection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maskValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputColumnName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
sampleFraction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
thresholdFraction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
inputs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PiiType
piiType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
entityTypesToDetect
instance Data.ToJSON PIIDetection where
toJSON :: PIIDetection -> Value
toJSON PIIDetection' {[Text]
Maybe Double
Maybe Text
NonEmpty Text
Text
PiiType
entityTypesToDetect :: [Text]
piiType :: PiiType
inputs :: NonEmpty Text
name :: Text
thresholdFraction :: Maybe Double
sampleFraction :: Maybe Double
outputColumnName :: Maybe Text
maskValue :: Maybe Text
$sel:entityTypesToDetect:PIIDetection' :: PIIDetection -> [Text]
$sel:piiType:PIIDetection' :: PIIDetection -> PiiType
$sel:inputs:PIIDetection' :: PIIDetection -> NonEmpty Text
$sel:name:PIIDetection' :: PIIDetection -> Text
$sel:thresholdFraction:PIIDetection' :: PIIDetection -> Maybe Double
$sel:sampleFraction:PIIDetection' :: PIIDetection -> Maybe Double
$sel:outputColumnName:PIIDetection' :: PIIDetection -> Maybe Text
$sel:maskValue:PIIDetection' :: PIIDetection -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaskValue" 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 Text
maskValue,
(Key
"OutputColumnName" 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 Text
outputColumnName,
(Key
"SampleFraction" 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 Double
sampleFraction,
(Key
"ThresholdFraction" 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 Double
thresholdFraction,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Inputs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
inputs),
forall a. a -> Maybe a
Prelude.Just (Key
"PiiType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= PiiType
piiType),
forall a. a -> Maybe a
Prelude.Just
(Key
"EntityTypesToDetect" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
entityTypesToDetect)
]
)