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