{-# 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.Glue.Types.TaskRunSortCriteria where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.SortDirectionType
import Amazonka.Glue.Types.TaskRunSortColumnType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TaskRunSortCriteria = TaskRunSortCriteria'
{
TaskRunSortCriteria -> TaskRunSortColumnType
column :: TaskRunSortColumnType,
TaskRunSortCriteria -> SortDirectionType
sortDirection :: SortDirectionType
}
deriving (TaskRunSortCriteria -> TaskRunSortCriteria -> Bool
(TaskRunSortCriteria -> TaskRunSortCriteria -> Bool)
-> (TaskRunSortCriteria -> TaskRunSortCriteria -> Bool)
-> Eq TaskRunSortCriteria
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskRunSortCriteria -> TaskRunSortCriteria -> Bool
$c/= :: TaskRunSortCriteria -> TaskRunSortCriteria -> Bool
== :: TaskRunSortCriteria -> TaskRunSortCriteria -> Bool
$c== :: TaskRunSortCriteria -> TaskRunSortCriteria -> Bool
Prelude.Eq, ReadPrec [TaskRunSortCriteria]
ReadPrec TaskRunSortCriteria
Int -> ReadS TaskRunSortCriteria
ReadS [TaskRunSortCriteria]
(Int -> ReadS TaskRunSortCriteria)
-> ReadS [TaskRunSortCriteria]
-> ReadPrec TaskRunSortCriteria
-> ReadPrec [TaskRunSortCriteria]
-> Read TaskRunSortCriteria
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaskRunSortCriteria]
$creadListPrec :: ReadPrec [TaskRunSortCriteria]
readPrec :: ReadPrec TaskRunSortCriteria
$creadPrec :: ReadPrec TaskRunSortCriteria
readList :: ReadS [TaskRunSortCriteria]
$creadList :: ReadS [TaskRunSortCriteria]
readsPrec :: Int -> ReadS TaskRunSortCriteria
$creadsPrec :: Int -> ReadS TaskRunSortCriteria
Prelude.Read, Int -> TaskRunSortCriteria -> ShowS
[TaskRunSortCriteria] -> ShowS
TaskRunSortCriteria -> String
(Int -> TaskRunSortCriteria -> ShowS)
-> (TaskRunSortCriteria -> String)
-> ([TaskRunSortCriteria] -> ShowS)
-> Show TaskRunSortCriteria
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskRunSortCriteria] -> ShowS
$cshowList :: [TaskRunSortCriteria] -> ShowS
show :: TaskRunSortCriteria -> String
$cshow :: TaskRunSortCriteria -> String
showsPrec :: Int -> TaskRunSortCriteria -> ShowS
$cshowsPrec :: Int -> TaskRunSortCriteria -> ShowS
Prelude.Show, (forall x. TaskRunSortCriteria -> Rep TaskRunSortCriteria x)
-> (forall x. Rep TaskRunSortCriteria x -> TaskRunSortCriteria)
-> Generic TaskRunSortCriteria
forall x. Rep TaskRunSortCriteria x -> TaskRunSortCriteria
forall x. TaskRunSortCriteria -> Rep TaskRunSortCriteria x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TaskRunSortCriteria x -> TaskRunSortCriteria
$cfrom :: forall x. TaskRunSortCriteria -> Rep TaskRunSortCriteria x
Prelude.Generic)
newTaskRunSortCriteria ::
TaskRunSortColumnType ->
SortDirectionType ->
TaskRunSortCriteria
newTaskRunSortCriteria :: TaskRunSortColumnType -> SortDirectionType -> TaskRunSortCriteria
newTaskRunSortCriteria TaskRunSortColumnType
pColumn_ SortDirectionType
pSortDirection_ =
TaskRunSortCriteria' :: TaskRunSortColumnType -> SortDirectionType -> TaskRunSortCriteria
TaskRunSortCriteria'
{ $sel:column:TaskRunSortCriteria' :: TaskRunSortColumnType
column = TaskRunSortColumnType
pColumn_,
$sel:sortDirection:TaskRunSortCriteria' :: SortDirectionType
sortDirection = SortDirectionType
pSortDirection_
}
taskRunSortCriteria_column :: Lens.Lens' TaskRunSortCriteria TaskRunSortColumnType
taskRunSortCriteria_column :: (TaskRunSortColumnType -> f TaskRunSortColumnType)
-> TaskRunSortCriteria -> f TaskRunSortCriteria
taskRunSortCriteria_column = (TaskRunSortCriteria -> TaskRunSortColumnType)
-> (TaskRunSortCriteria
-> TaskRunSortColumnType -> TaskRunSortCriteria)
-> Lens
TaskRunSortCriteria
TaskRunSortCriteria
TaskRunSortColumnType
TaskRunSortColumnType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskRunSortCriteria' {TaskRunSortColumnType
column :: TaskRunSortColumnType
$sel:column:TaskRunSortCriteria' :: TaskRunSortCriteria -> TaskRunSortColumnType
column} -> TaskRunSortColumnType
column) (\s :: TaskRunSortCriteria
s@TaskRunSortCriteria' {} TaskRunSortColumnType
a -> TaskRunSortCriteria
s {$sel:column:TaskRunSortCriteria' :: TaskRunSortColumnType
column = TaskRunSortColumnType
a} :: TaskRunSortCriteria)
taskRunSortCriteria_sortDirection :: Lens.Lens' TaskRunSortCriteria SortDirectionType
taskRunSortCriteria_sortDirection :: (SortDirectionType -> f SortDirectionType)
-> TaskRunSortCriteria -> f TaskRunSortCriteria
taskRunSortCriteria_sortDirection = (TaskRunSortCriteria -> SortDirectionType)
-> (TaskRunSortCriteria
-> SortDirectionType -> TaskRunSortCriteria)
-> Lens
TaskRunSortCriteria
TaskRunSortCriteria
SortDirectionType
SortDirectionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskRunSortCriteria' {SortDirectionType
sortDirection :: SortDirectionType
$sel:sortDirection:TaskRunSortCriteria' :: TaskRunSortCriteria -> SortDirectionType
sortDirection} -> SortDirectionType
sortDirection) (\s :: TaskRunSortCriteria
s@TaskRunSortCriteria' {} SortDirectionType
a -> TaskRunSortCriteria
s {$sel:sortDirection:TaskRunSortCriteria' :: SortDirectionType
sortDirection = SortDirectionType
a} :: TaskRunSortCriteria)
instance Prelude.Hashable TaskRunSortCriteria
instance Prelude.NFData TaskRunSortCriteria
instance Core.ToJSON TaskRunSortCriteria where
toJSON :: TaskRunSortCriteria -> Value
toJSON TaskRunSortCriteria' {SortDirectionType
TaskRunSortColumnType
sortDirection :: SortDirectionType
column :: TaskRunSortColumnType
$sel:sortDirection:TaskRunSortCriteria' :: TaskRunSortCriteria -> SortDirectionType
$sel:column:TaskRunSortCriteria' :: TaskRunSortCriteria -> TaskRunSortColumnType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Column" Text -> TaskRunSortColumnType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TaskRunSortColumnType
column),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SortDirection" Text -> SortDirectionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SortDirectionType
sortDirection)
]
)