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