{-# 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.SearchResourcesCriteria where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.SearchResourcesSimpleCriterion
import Amazonka.MacieV2.Types.SearchResourcesTagCriterion
import qualified Amazonka.Prelude as Prelude
data SearchResourcesCriteria = SearchResourcesCriteria'
{
SearchResourcesCriteria -> Maybe SearchResourcesTagCriterion
tagCriterion :: Prelude.Maybe SearchResourcesTagCriterion,
SearchResourcesCriteria -> Maybe SearchResourcesSimpleCriterion
simpleCriterion :: Prelude.Maybe SearchResourcesSimpleCriterion
}
deriving (SearchResourcesCriteria -> SearchResourcesCriteria -> Bool
(SearchResourcesCriteria -> SearchResourcesCriteria -> Bool)
-> (SearchResourcesCriteria -> SearchResourcesCriteria -> Bool)
-> Eq SearchResourcesCriteria
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchResourcesCriteria -> SearchResourcesCriteria -> Bool
$c/= :: SearchResourcesCriteria -> SearchResourcesCriteria -> Bool
== :: SearchResourcesCriteria -> SearchResourcesCriteria -> Bool
$c== :: SearchResourcesCriteria -> SearchResourcesCriteria -> Bool
Prelude.Eq, ReadPrec [SearchResourcesCriteria]
ReadPrec SearchResourcesCriteria
Int -> ReadS SearchResourcesCriteria
ReadS [SearchResourcesCriteria]
(Int -> ReadS SearchResourcesCriteria)
-> ReadS [SearchResourcesCriteria]
-> ReadPrec SearchResourcesCriteria
-> ReadPrec [SearchResourcesCriteria]
-> Read SearchResourcesCriteria
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchResourcesCriteria]
$creadListPrec :: ReadPrec [SearchResourcesCriteria]
readPrec :: ReadPrec SearchResourcesCriteria
$creadPrec :: ReadPrec SearchResourcesCriteria
readList :: ReadS [SearchResourcesCriteria]
$creadList :: ReadS [SearchResourcesCriteria]
readsPrec :: Int -> ReadS SearchResourcesCriteria
$creadsPrec :: Int -> ReadS SearchResourcesCriteria
Prelude.Read, Int -> SearchResourcesCriteria -> ShowS
[SearchResourcesCriteria] -> ShowS
SearchResourcesCriteria -> String
(Int -> SearchResourcesCriteria -> ShowS)
-> (SearchResourcesCriteria -> String)
-> ([SearchResourcesCriteria] -> ShowS)
-> Show SearchResourcesCriteria
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchResourcesCriteria] -> ShowS
$cshowList :: [SearchResourcesCriteria] -> ShowS
show :: SearchResourcesCriteria -> String
$cshow :: SearchResourcesCriteria -> String
showsPrec :: Int -> SearchResourcesCriteria -> ShowS
$cshowsPrec :: Int -> SearchResourcesCriteria -> ShowS
Prelude.Show, (forall x.
SearchResourcesCriteria -> Rep SearchResourcesCriteria x)
-> (forall x.
Rep SearchResourcesCriteria x -> SearchResourcesCriteria)
-> Generic SearchResourcesCriteria
forall x. Rep SearchResourcesCriteria x -> SearchResourcesCriteria
forall x. SearchResourcesCriteria -> Rep SearchResourcesCriteria x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchResourcesCriteria x -> SearchResourcesCriteria
$cfrom :: forall x. SearchResourcesCriteria -> Rep SearchResourcesCriteria x
Prelude.Generic)
newSearchResourcesCriteria ::
SearchResourcesCriteria
newSearchResourcesCriteria :: SearchResourcesCriteria
newSearchResourcesCriteria =
SearchResourcesCriteria' :: Maybe SearchResourcesTagCriterion
-> Maybe SearchResourcesSimpleCriterion -> SearchResourcesCriteria
SearchResourcesCriteria'
{ $sel:tagCriterion:SearchResourcesCriteria' :: Maybe SearchResourcesTagCriterion
tagCriterion =
Maybe SearchResourcesTagCriterion
forall a. Maybe a
Prelude.Nothing,
$sel:simpleCriterion:SearchResourcesCriteria' :: Maybe SearchResourcesSimpleCriterion
simpleCriterion = Maybe SearchResourcesSimpleCriterion
forall a. Maybe a
Prelude.Nothing
}
searchResourcesCriteria_tagCriterion :: Lens.Lens' SearchResourcesCriteria (Prelude.Maybe SearchResourcesTagCriterion)
searchResourcesCriteria_tagCriterion :: (Maybe SearchResourcesTagCriterion
-> f (Maybe SearchResourcesTagCriterion))
-> SearchResourcesCriteria -> f SearchResourcesCriteria
searchResourcesCriteria_tagCriterion = (SearchResourcesCriteria -> Maybe SearchResourcesTagCriterion)
-> (SearchResourcesCriteria
-> Maybe SearchResourcesTagCriterion -> SearchResourcesCriteria)
-> Lens
SearchResourcesCriteria
SearchResourcesCriteria
(Maybe SearchResourcesTagCriterion)
(Maybe SearchResourcesTagCriterion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchResourcesCriteria' {Maybe SearchResourcesTagCriterion
tagCriterion :: Maybe SearchResourcesTagCriterion
$sel:tagCriterion:SearchResourcesCriteria' :: SearchResourcesCriteria -> Maybe SearchResourcesTagCriterion
tagCriterion} -> Maybe SearchResourcesTagCriterion
tagCriterion) (\s :: SearchResourcesCriteria
s@SearchResourcesCriteria' {} Maybe SearchResourcesTagCriterion
a -> SearchResourcesCriteria
s {$sel:tagCriterion:SearchResourcesCriteria' :: Maybe SearchResourcesTagCriterion
tagCriterion = Maybe SearchResourcesTagCriterion
a} :: SearchResourcesCriteria)
searchResourcesCriteria_simpleCriterion :: Lens.Lens' SearchResourcesCriteria (Prelude.Maybe SearchResourcesSimpleCriterion)
searchResourcesCriteria_simpleCriterion :: (Maybe SearchResourcesSimpleCriterion
-> f (Maybe SearchResourcesSimpleCriterion))
-> SearchResourcesCriteria -> f SearchResourcesCriteria
searchResourcesCriteria_simpleCriterion = (SearchResourcesCriteria -> Maybe SearchResourcesSimpleCriterion)
-> (SearchResourcesCriteria
-> Maybe SearchResourcesSimpleCriterion -> SearchResourcesCriteria)
-> Lens
SearchResourcesCriteria
SearchResourcesCriteria
(Maybe SearchResourcesSimpleCriterion)
(Maybe SearchResourcesSimpleCriterion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchResourcesCriteria' {Maybe SearchResourcesSimpleCriterion
simpleCriterion :: Maybe SearchResourcesSimpleCriterion
$sel:simpleCriterion:SearchResourcesCriteria' :: SearchResourcesCriteria -> Maybe SearchResourcesSimpleCriterion
simpleCriterion} -> Maybe SearchResourcesSimpleCriterion
simpleCriterion) (\s :: SearchResourcesCriteria
s@SearchResourcesCriteria' {} Maybe SearchResourcesSimpleCriterion
a -> SearchResourcesCriteria
s {$sel:simpleCriterion:SearchResourcesCriteria' :: Maybe SearchResourcesSimpleCriterion
simpleCriterion = Maybe SearchResourcesSimpleCriterion
a} :: SearchResourcesCriteria)
instance Prelude.Hashable SearchResourcesCriteria
instance Prelude.NFData SearchResourcesCriteria
instance Core.ToJSON SearchResourcesCriteria where
toJSON :: SearchResourcesCriteria -> Value
toJSON SearchResourcesCriteria' {Maybe SearchResourcesSimpleCriterion
Maybe SearchResourcesTagCriterion
simpleCriterion :: Maybe SearchResourcesSimpleCriterion
tagCriterion :: Maybe SearchResourcesTagCriterion
$sel:simpleCriterion:SearchResourcesCriteria' :: SearchResourcesCriteria -> Maybe SearchResourcesSimpleCriterion
$sel:tagCriterion:SearchResourcesCriteria' :: SearchResourcesCriteria -> Maybe SearchResourcesTagCriterion
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"tagCriterion" Text -> SearchResourcesTagCriterion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SearchResourcesTagCriterion -> Pair)
-> Maybe SearchResourcesTagCriterion -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SearchResourcesTagCriterion
tagCriterion,
(Text
"simpleCriterion" Text -> SearchResourcesSimpleCriterion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SearchResourcesSimpleCriterion -> Pair)
-> Maybe SearchResourcesSimpleCriterion -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SearchResourcesSimpleCriterion
simpleCriterion
]
)