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