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