{-# 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.MacieV2.Types.SimpleCriterionForJob where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.JobComparator
import Amazonka.MacieV2.Types.SimpleCriterionKeyForJob
import qualified Amazonka.Prelude as Prelude
data SimpleCriterionForJob = SimpleCriterionForJob'
{
SimpleCriterionForJob -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text],
SimpleCriterionForJob -> Maybe SimpleCriterionKeyForJob
key :: Prelude.Maybe SimpleCriterionKeyForJob,
SimpleCriterionForJob -> Maybe JobComparator
comparator :: Prelude.Maybe JobComparator
}
deriving (SimpleCriterionForJob -> SimpleCriterionForJob -> Bool
(SimpleCriterionForJob -> SimpleCriterionForJob -> Bool)
-> (SimpleCriterionForJob -> SimpleCriterionForJob -> Bool)
-> Eq SimpleCriterionForJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SimpleCriterionForJob -> SimpleCriterionForJob -> Bool
$c/= :: SimpleCriterionForJob -> SimpleCriterionForJob -> Bool
== :: SimpleCriterionForJob -> SimpleCriterionForJob -> Bool
$c== :: SimpleCriterionForJob -> SimpleCriterionForJob -> Bool
Prelude.Eq, ReadPrec [SimpleCriterionForJob]
ReadPrec SimpleCriterionForJob
Int -> ReadS SimpleCriterionForJob
ReadS [SimpleCriterionForJob]
(Int -> ReadS SimpleCriterionForJob)
-> ReadS [SimpleCriterionForJob]
-> ReadPrec SimpleCriterionForJob
-> ReadPrec [SimpleCriterionForJob]
-> Read SimpleCriterionForJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SimpleCriterionForJob]
$creadListPrec :: ReadPrec [SimpleCriterionForJob]
readPrec :: ReadPrec SimpleCriterionForJob
$creadPrec :: ReadPrec SimpleCriterionForJob
readList :: ReadS [SimpleCriterionForJob]
$creadList :: ReadS [SimpleCriterionForJob]
readsPrec :: Int -> ReadS SimpleCriterionForJob
$creadsPrec :: Int -> ReadS SimpleCriterionForJob
Prelude.Read, Int -> SimpleCriterionForJob -> ShowS
[SimpleCriterionForJob] -> ShowS
SimpleCriterionForJob -> String
(Int -> SimpleCriterionForJob -> ShowS)
-> (SimpleCriterionForJob -> String)
-> ([SimpleCriterionForJob] -> ShowS)
-> Show SimpleCriterionForJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SimpleCriterionForJob] -> ShowS
$cshowList :: [SimpleCriterionForJob] -> ShowS
show :: SimpleCriterionForJob -> String
$cshow :: SimpleCriterionForJob -> String
showsPrec :: Int -> SimpleCriterionForJob -> ShowS
$cshowsPrec :: Int -> SimpleCriterionForJob -> ShowS
Prelude.Show, (forall x. SimpleCriterionForJob -> Rep SimpleCriterionForJob x)
-> (forall x. Rep SimpleCriterionForJob x -> SimpleCriterionForJob)
-> Generic SimpleCriterionForJob
forall x. Rep SimpleCriterionForJob x -> SimpleCriterionForJob
forall x. SimpleCriterionForJob -> Rep SimpleCriterionForJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SimpleCriterionForJob x -> SimpleCriterionForJob
$cfrom :: forall x. SimpleCriterionForJob -> Rep SimpleCriterionForJob x
Prelude.Generic)
newSimpleCriterionForJob ::
SimpleCriterionForJob
newSimpleCriterionForJob :: SimpleCriterionForJob
newSimpleCriterionForJob =
SimpleCriterionForJob' :: Maybe [Text]
-> Maybe SimpleCriterionKeyForJob
-> Maybe JobComparator
-> SimpleCriterionForJob
SimpleCriterionForJob'
{ $sel:values:SimpleCriterionForJob' :: Maybe [Text]
values = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:key:SimpleCriterionForJob' :: Maybe SimpleCriterionKeyForJob
key = Maybe SimpleCriterionKeyForJob
forall a. Maybe a
Prelude.Nothing,
$sel:comparator:SimpleCriterionForJob' :: Maybe JobComparator
comparator = Maybe JobComparator
forall a. Maybe a
Prelude.Nothing
}
simpleCriterionForJob_values :: Lens.Lens' SimpleCriterionForJob (Prelude.Maybe [Prelude.Text])
simpleCriterionForJob_values :: (Maybe [Text] -> f (Maybe [Text]))
-> SimpleCriterionForJob -> f SimpleCriterionForJob
simpleCriterionForJob_values = (SimpleCriterionForJob -> Maybe [Text])
-> (SimpleCriterionForJob -> Maybe [Text] -> SimpleCriterionForJob)
-> Lens
SimpleCriterionForJob
SimpleCriterionForJob
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimpleCriterionForJob' {Maybe [Text]
values :: Maybe [Text]
$sel:values:SimpleCriterionForJob' :: SimpleCriterionForJob -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: SimpleCriterionForJob
s@SimpleCriterionForJob' {} Maybe [Text]
a -> SimpleCriterionForJob
s {$sel:values:SimpleCriterionForJob' :: Maybe [Text]
values = Maybe [Text]
a} :: SimpleCriterionForJob) ((Maybe [Text] -> f (Maybe [Text]))
-> SimpleCriterionForJob -> f SimpleCriterionForJob)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SimpleCriterionForJob
-> f SimpleCriterionForJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
simpleCriterionForJob_key :: Lens.Lens' SimpleCriterionForJob (Prelude.Maybe SimpleCriterionKeyForJob)
simpleCriterionForJob_key :: (Maybe SimpleCriterionKeyForJob
-> f (Maybe SimpleCriterionKeyForJob))
-> SimpleCriterionForJob -> f SimpleCriterionForJob
simpleCriterionForJob_key = (SimpleCriterionForJob -> Maybe SimpleCriterionKeyForJob)
-> (SimpleCriterionForJob
-> Maybe SimpleCriterionKeyForJob -> SimpleCriterionForJob)
-> Lens
SimpleCriterionForJob
SimpleCriterionForJob
(Maybe SimpleCriterionKeyForJob)
(Maybe SimpleCriterionKeyForJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimpleCriterionForJob' {Maybe SimpleCriterionKeyForJob
key :: Maybe SimpleCriterionKeyForJob
$sel:key:SimpleCriterionForJob' :: SimpleCriterionForJob -> Maybe SimpleCriterionKeyForJob
key} -> Maybe SimpleCriterionKeyForJob
key) (\s :: SimpleCriterionForJob
s@SimpleCriterionForJob' {} Maybe SimpleCriterionKeyForJob
a -> SimpleCriterionForJob
s {$sel:key:SimpleCriterionForJob' :: Maybe SimpleCriterionKeyForJob
key = Maybe SimpleCriterionKeyForJob
a} :: SimpleCriterionForJob)
simpleCriterionForJob_comparator :: Lens.Lens' SimpleCriterionForJob (Prelude.Maybe JobComparator)
simpleCriterionForJob_comparator :: (Maybe JobComparator -> f (Maybe JobComparator))
-> SimpleCriterionForJob -> f SimpleCriterionForJob
simpleCriterionForJob_comparator = (SimpleCriterionForJob -> Maybe JobComparator)
-> (SimpleCriterionForJob
-> Maybe JobComparator -> SimpleCriterionForJob)
-> Lens
SimpleCriterionForJob
SimpleCriterionForJob
(Maybe JobComparator)
(Maybe JobComparator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimpleCriterionForJob' {Maybe JobComparator
comparator :: Maybe JobComparator
$sel:comparator:SimpleCriterionForJob' :: SimpleCriterionForJob -> Maybe JobComparator
comparator} -> Maybe JobComparator
comparator) (\s :: SimpleCriterionForJob
s@SimpleCriterionForJob' {} Maybe JobComparator
a -> SimpleCriterionForJob
s {$sel:comparator:SimpleCriterionForJob' :: Maybe JobComparator
comparator = Maybe JobComparator
a} :: SimpleCriterionForJob)
instance Core.FromJSON SimpleCriterionForJob where
parseJSON :: Value -> Parser SimpleCriterionForJob
parseJSON =
String
-> (Object -> Parser SimpleCriterionForJob)
-> Value
-> Parser SimpleCriterionForJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SimpleCriterionForJob"
( \Object
x ->
Maybe [Text]
-> Maybe SimpleCriterionKeyForJob
-> Maybe JobComparator
-> SimpleCriterionForJob
SimpleCriterionForJob'
(Maybe [Text]
-> Maybe SimpleCriterionKeyForJob
-> Maybe JobComparator
-> SimpleCriterionForJob)
-> Parser (Maybe [Text])
-> Parser
(Maybe SimpleCriterionKeyForJob
-> Maybe JobComparator -> SimpleCriterionForJob)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"values" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe SimpleCriterionKeyForJob
-> Maybe JobComparator -> SimpleCriterionForJob)
-> Parser (Maybe SimpleCriterionKeyForJob)
-> Parser (Maybe JobComparator -> SimpleCriterionForJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SimpleCriterionKeyForJob)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"key")
Parser (Maybe JobComparator -> SimpleCriterionForJob)
-> Parser (Maybe JobComparator) -> Parser SimpleCriterionForJob
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobComparator)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"comparator")
)
instance Prelude.Hashable SimpleCriterionForJob
instance Prelude.NFData SimpleCriterionForJob
instance Core.ToJSON SimpleCriterionForJob where
toJSON :: SimpleCriterionForJob -> Value
toJSON SimpleCriterionForJob' {Maybe [Text]
Maybe JobComparator
Maybe SimpleCriterionKeyForJob
comparator :: Maybe JobComparator
key :: Maybe SimpleCriterionKeyForJob
values :: Maybe [Text]
$sel:comparator:SimpleCriterionForJob' :: SimpleCriterionForJob -> Maybe JobComparator
$sel:key:SimpleCriterionForJob' :: SimpleCriterionForJob -> Maybe SimpleCriterionKeyForJob
$sel:values:SimpleCriterionForJob' :: SimpleCriterionForJob -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"values" 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]
values,
(Text
"key" Text -> SimpleCriterionKeyForJob -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SimpleCriterionKeyForJob -> Pair)
-> Maybe SimpleCriterionKeyForJob -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimpleCriterionKeyForJob
key,
(Text
"comparator" Text -> JobComparator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobComparator -> Pair) -> Maybe JobComparator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobComparator
comparator
]
)