{-# 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.Lens as Lens
import Amazonka.MacieV2.Types.SimpleCriterionForJob
import Amazonka.MacieV2.Types.TagCriterionForJob
import qualified Amazonka.Prelude as Prelude
data CriteriaForJob = CriteriaForJob'
{
CriteriaForJob -> Maybe TagCriterionForJob
tagCriterion :: Prelude.Maybe TagCriterionForJob,
CriteriaForJob -> Maybe SimpleCriterionForJob
simpleCriterion :: Prelude.Maybe SimpleCriterionForJob
}
deriving (CriteriaForJob -> CriteriaForJob -> Bool
(CriteriaForJob -> CriteriaForJob -> Bool)
-> (CriteriaForJob -> CriteriaForJob -> Bool) -> Eq CriteriaForJob
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]
(Int -> ReadS CriteriaForJob)
-> ReadS [CriteriaForJob]
-> ReadPrec CriteriaForJob
-> ReadPrec [CriteriaForJob]
-> Read 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
(Int -> CriteriaForJob -> ShowS)
-> (CriteriaForJob -> String)
-> ([CriteriaForJob] -> ShowS)
-> Show CriteriaForJob
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. CriteriaForJob -> Rep CriteriaForJob x)
-> (forall x. Rep CriteriaForJob x -> CriteriaForJob)
-> Generic CriteriaForJob
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' :: Maybe TagCriterionForJob
-> Maybe SimpleCriterionForJob -> CriteriaForJob
CriteriaForJob'
{ $sel:tagCriterion:CriteriaForJob' :: Maybe TagCriterionForJob
tagCriterion = Maybe TagCriterionForJob
forall a. Maybe a
Prelude.Nothing,
$sel:simpleCriterion:CriteriaForJob' :: Maybe SimpleCriterionForJob
simpleCriterion = Maybe SimpleCriterionForJob
forall a. Maybe a
Prelude.Nothing
}
criteriaForJob_tagCriterion :: Lens.Lens' CriteriaForJob (Prelude.Maybe TagCriterionForJob)
criteriaForJob_tagCriterion :: (Maybe TagCriterionForJob -> f (Maybe TagCriterionForJob))
-> CriteriaForJob -> f CriteriaForJob
criteriaForJob_tagCriterion = (CriteriaForJob -> Maybe TagCriterionForJob)
-> (CriteriaForJob -> Maybe TagCriterionForJob -> CriteriaForJob)
-> Lens
CriteriaForJob
CriteriaForJob
(Maybe TagCriterionForJob)
(Maybe TagCriterionForJob)
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)
criteriaForJob_simpleCriterion :: Lens.Lens' CriteriaForJob (Prelude.Maybe SimpleCriterionForJob)
criteriaForJob_simpleCriterion :: (Maybe SimpleCriterionForJob -> f (Maybe SimpleCriterionForJob))
-> CriteriaForJob -> f CriteriaForJob
criteriaForJob_simpleCriterion = (CriteriaForJob -> Maybe SimpleCriterionForJob)
-> (CriteriaForJob
-> Maybe SimpleCriterionForJob -> CriteriaForJob)
-> Lens
CriteriaForJob
CriteriaForJob
(Maybe SimpleCriterionForJob)
(Maybe SimpleCriterionForJob)
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)
instance Core.FromJSON CriteriaForJob where
parseJSON :: Value -> Parser CriteriaForJob
parseJSON =
String
-> (Object -> Parser CriteriaForJob)
-> Value
-> Parser CriteriaForJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CriteriaForJob"
( \Object
x ->
Maybe TagCriterionForJob
-> Maybe SimpleCriterionForJob -> CriteriaForJob
CriteriaForJob'
(Maybe TagCriterionForJob
-> Maybe SimpleCriterionForJob -> CriteriaForJob)
-> Parser (Maybe TagCriterionForJob)
-> Parser (Maybe SimpleCriterionForJob -> CriteriaForJob)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TagCriterionForJob)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tagCriterion")
Parser (Maybe SimpleCriterionForJob -> CriteriaForJob)
-> Parser (Maybe SimpleCriterionForJob) -> Parser CriteriaForJob
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SimpleCriterionForJob)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"simpleCriterion")
)
instance Prelude.Hashable CriteriaForJob
instance Prelude.NFData CriteriaForJob
instance Core.ToJSON CriteriaForJob where
toJSON :: CriteriaForJob -> Value
toJSON CriteriaForJob' {Maybe SimpleCriterionForJob
Maybe TagCriterionForJob
simpleCriterion :: Maybe SimpleCriterionForJob
tagCriterion :: Maybe TagCriterionForJob
$sel:simpleCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe SimpleCriterionForJob
$sel:tagCriterion:CriteriaForJob' :: CriteriaForJob -> Maybe TagCriterionForJob
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"tagCriterion" Text -> TagCriterionForJob -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TagCriterionForJob -> Pair)
-> Maybe TagCriterionForJob -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TagCriterionForJob
tagCriterion,
(Text
"simpleCriterion" Text -> SimpleCriterionForJob -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SimpleCriterionForJob -> Pair)
-> Maybe SimpleCriterionForJob -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimpleCriterionForJob
simpleCriterion
]
)