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