{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.SearchResourcesComparator
import Amazonka.MacieV2.Types.SearchResourcesSimpleCriterionKey
import qualified Amazonka.Prelude as Prelude
data SearchResourcesSimpleCriterion = SearchResourcesSimpleCriterion'
{
SearchResourcesSimpleCriterion -> Maybe SearchResourcesComparator
comparator :: Prelude.Maybe SearchResourcesComparator,
SearchResourcesSimpleCriterion
-> Maybe SearchResourcesSimpleCriterionKey
key :: Prelude.Maybe SearchResourcesSimpleCriterionKey,
SearchResourcesSimpleCriterion -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text]
}
deriving (SearchResourcesSimpleCriterion
-> SearchResourcesSimpleCriterion -> Bool
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]
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
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.
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'
{ $sel:comparator:SearchResourcesSimpleCriterion' :: Maybe SearchResourcesComparator
comparator =
forall a. Maybe a
Prelude.Nothing,
$sel:key:SearchResourcesSimpleCriterion' :: Maybe SearchResourcesSimpleCriterionKey
key = forall a. Maybe a
Prelude.Nothing,
$sel:values:SearchResourcesSimpleCriterion' :: Maybe [Text]
values = forall a. Maybe a
Prelude.Nothing
}
searchResourcesSimpleCriterion_comparator :: Lens.Lens' SearchResourcesSimpleCriterion (Prelude.Maybe SearchResourcesComparator)
searchResourcesSimpleCriterion_comparator :: Lens'
SearchResourcesSimpleCriterion (Maybe SearchResourcesComparator)
searchResourcesSimpleCriterion_comparator = 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)
searchResourcesSimpleCriterion_key :: Lens.Lens' SearchResourcesSimpleCriterion (Prelude.Maybe SearchResourcesSimpleCriterionKey)
searchResourcesSimpleCriterion_key :: Lens'
SearchResourcesSimpleCriterion
(Maybe SearchResourcesSimpleCriterionKey)
searchResourcesSimpleCriterion_key = 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_values :: Lens.Lens' SearchResourcesSimpleCriterion (Prelude.Maybe [Prelude.Text])
searchResourcesSimpleCriterion_values :: Lens' SearchResourcesSimpleCriterion (Maybe [Text])
searchResourcesSimpleCriterion_values = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.Hashable
SearchResourcesSimpleCriterion
where
hashWithSalt :: Int -> SearchResourcesSimpleCriterion -> Int
hashWithSalt
Int
_salt
SearchResourcesSimpleCriterion' {Maybe [Text]
Maybe SearchResourcesComparator
Maybe SearchResourcesSimpleCriterionKey
values :: Maybe [Text]
key :: Maybe SearchResourcesSimpleCriterionKey
comparator :: Maybe SearchResourcesComparator
$sel:values:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion -> Maybe [Text]
$sel:key:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion
-> Maybe SearchResourcesSimpleCriterionKey
$sel:comparator:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion -> Maybe SearchResourcesComparator
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SearchResourcesComparator
comparator
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SearchResourcesSimpleCriterionKey
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
values
instance
Prelude.NFData
SearchResourcesSimpleCriterion
where
rnf :: SearchResourcesSimpleCriterion -> ()
rnf SearchResourcesSimpleCriterion' {Maybe [Text]
Maybe SearchResourcesComparator
Maybe SearchResourcesSimpleCriterionKey
values :: Maybe [Text]
key :: Maybe SearchResourcesSimpleCriterionKey
comparator :: Maybe SearchResourcesComparator
$sel:values:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion -> Maybe [Text]
$sel:key:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion
-> Maybe SearchResourcesSimpleCriterionKey
$sel:comparator:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion -> Maybe SearchResourcesComparator
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SearchResourcesComparator
comparator
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SearchResourcesSimpleCriterionKey
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
values
instance Data.ToJSON SearchResourcesSimpleCriterion where
toJSON :: SearchResourcesSimpleCriterion -> Value
toJSON SearchResourcesSimpleCriterion' {Maybe [Text]
Maybe SearchResourcesComparator
Maybe SearchResourcesSimpleCriterionKey
values :: Maybe [Text]
key :: Maybe SearchResourcesSimpleCriterionKey
comparator :: Maybe SearchResourcesComparator
$sel:values:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion -> Maybe [Text]
$sel:key:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion
-> Maybe SearchResourcesSimpleCriterionKey
$sel:comparator:SearchResourcesSimpleCriterion' :: SearchResourcesSimpleCriterion -> Maybe SearchResourcesComparator
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"comparator" 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 SearchResourcesComparator
comparator,
(Key
"key" 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 SearchResourcesSimpleCriterionKey
key,
(Key
"values" 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 [Text]
values
]
)