{-# 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.CriteriaForJob where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.SimpleCriterionForJob
import Amazonka.MacieV2.Types.TagCriterionForJob
import qualified Amazonka.Prelude as Prelude
data CriteriaForJob = CriteriaForJob'
{
CriteriaForJob -> Maybe SimpleCriterionForJob
simpleCriterion :: Prelude.Maybe SimpleCriterionForJob,
CriteriaForJob -> Maybe TagCriterionForJob
tagCriterion :: Prelude.Maybe TagCriterionForJob
}
deriving (CriteriaForJob -> CriteriaForJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CriteriaForJob -> CriteriaForJob -> Bool
$c/= :: CriteriaForJob -> CriteriaForJob -> Bool
== :: CriteriaForJob -> CriteriaForJob -> Bool
$c== :: CriteriaForJob -> CriteriaForJob -> Bool
Prelude.Eq, ReadPrec [CriteriaForJob]
ReadPrec CriteriaForJob
Int -> ReadS CriteriaForJob
ReadS [CriteriaForJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CriteriaForJob]
$creadListPrec :: ReadPrec [CriteriaForJob]
readPrec :: ReadPrec CriteriaForJob
$creadPrec :: ReadPrec CriteriaForJob
readList :: ReadS [CriteriaForJob]
$creadList :: ReadS [CriteriaForJob]
readsPrec :: Int -> ReadS CriteriaForJob
$creadsPrec :: Int -> ReadS CriteriaForJob
Prelude.Read, Int -> CriteriaForJob -> ShowS
[CriteriaForJob] -> ShowS
CriteriaForJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CriteriaForJob] -> ShowS
$cshowList :: [CriteriaForJob] -> ShowS
show :: CriteriaForJob -> String
$cshow :: CriteriaForJob -> String
showsPrec :: Int -> CriteriaForJob -> ShowS
$cshowsPrec :: Int -> CriteriaForJob -> ShowS
Prelude.Show, forall x. Rep CriteriaForJob x -> CriteriaForJob
forall x. CriteriaForJob -> Rep CriteriaForJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CriteriaForJob x -> CriteriaForJob
$cfrom :: forall x. CriteriaForJob -> Rep CriteriaForJob x
Prelude.Generic)
newCriteriaForJob ::
CriteriaForJob
newCriteriaForJob :: CriteriaForJob
newCriteriaForJob =
CriteriaForJob'
{ $sel:simpleCriterion:CriteriaForJob' :: Maybe SimpleCriterionForJob
simpleCriterion = forall a. Maybe a
Prelude.Nothing,
$sel:tagCriterion:CriteriaForJob' :: Maybe TagCriterionForJob
tagCriterion = forall a. Maybe a
Prelude.Nothing
}
criteriaForJob_simpleCriterion :: Lens.Lens' CriteriaForJob (Prelude.Maybe SimpleCriterionForJob)
criteriaForJob_simpleCriterion :: Lens' CriteriaForJob (Maybe SimpleCriterionForJob)
criteriaForJob_simpleCriterion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriteriaForJob' {Maybe SimpleCriterionForJob
simpleCriterion :: Maybe SimpleCriterionForJob
$sel:simpleCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe SimpleCriterionForJob
simpleCriterion} -> Maybe SimpleCriterionForJob
simpleCriterion) (\s :: CriteriaForJob
s@CriteriaForJob' {} Maybe SimpleCriterionForJob
a -> CriteriaForJob
s {$sel:simpleCriterion:CriteriaForJob' :: Maybe SimpleCriterionForJob
simpleCriterion = Maybe SimpleCriterionForJob
a} :: CriteriaForJob)
criteriaForJob_tagCriterion :: Lens.Lens' CriteriaForJob (Prelude.Maybe TagCriterionForJob)
criteriaForJob_tagCriterion :: Lens' CriteriaForJob (Maybe TagCriterionForJob)
criteriaForJob_tagCriterion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriteriaForJob' {Maybe TagCriterionForJob
tagCriterion :: Maybe TagCriterionForJob
$sel:tagCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe TagCriterionForJob
tagCriterion} -> Maybe TagCriterionForJob
tagCriterion) (\s :: CriteriaForJob
s@CriteriaForJob' {} Maybe TagCriterionForJob
a -> CriteriaForJob
s {$sel:tagCriterion:CriteriaForJob' :: Maybe TagCriterionForJob
tagCriterion = Maybe TagCriterionForJob
a} :: CriteriaForJob)
instance Data.FromJSON CriteriaForJob where
parseJSON :: Value -> Parser CriteriaForJob
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CriteriaForJob"
( \Object
x ->
Maybe SimpleCriterionForJob
-> Maybe TagCriterionForJob -> CriteriaForJob
CriteriaForJob'
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
"simpleCriterion")
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
"tagCriterion")
)
instance Prelude.Hashable CriteriaForJob where
hashWithSalt :: Int -> CriteriaForJob -> Int
hashWithSalt Int
_salt CriteriaForJob' {Maybe SimpleCriterionForJob
Maybe TagCriterionForJob
tagCriterion :: Maybe TagCriterionForJob
simpleCriterion :: Maybe SimpleCriterionForJob
$sel:tagCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe TagCriterionForJob
$sel:simpleCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe SimpleCriterionForJob
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SimpleCriterionForJob
simpleCriterion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TagCriterionForJob
tagCriterion
instance Prelude.NFData CriteriaForJob where
rnf :: CriteriaForJob -> ()
rnf CriteriaForJob' {Maybe SimpleCriterionForJob
Maybe TagCriterionForJob
tagCriterion :: Maybe TagCriterionForJob
simpleCriterion :: Maybe SimpleCriterionForJob
$sel:tagCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe TagCriterionForJob
$sel:simpleCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe SimpleCriterionForJob
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SimpleCriterionForJob
simpleCriterion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TagCriterionForJob
tagCriterion
instance Data.ToJSON CriteriaForJob where
toJSON :: CriteriaForJob -> Value
toJSON CriteriaForJob' {Maybe SimpleCriterionForJob
Maybe TagCriterionForJob
tagCriterion :: Maybe TagCriterionForJob
simpleCriterion :: Maybe SimpleCriterionForJob
$sel:tagCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe TagCriterionForJob
$sel:simpleCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe SimpleCriterionForJob
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"simpleCriterion" 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 SimpleCriterionForJob
simpleCriterion,
(Key
"tagCriterion" 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 TagCriterionForJob
tagCriterion
]
)