{-# 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.LexV2Models.Types.SlotSortBy where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.SlotSortAttribute
import Amazonka.LexV2Models.Types.SortOrder
import qualified Amazonka.Prelude as Prelude
data SlotSortBy = SlotSortBy'
{
SlotSortBy -> SlotSortAttribute
attribute :: SlotSortAttribute,
SlotSortBy -> SortOrder
order :: SortOrder
}
deriving (SlotSortBy -> SlotSortBy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlotSortBy -> SlotSortBy -> Bool
$c/= :: SlotSortBy -> SlotSortBy -> Bool
== :: SlotSortBy -> SlotSortBy -> Bool
$c== :: SlotSortBy -> SlotSortBy -> Bool
Prelude.Eq, ReadPrec [SlotSortBy]
ReadPrec SlotSortBy
Int -> ReadS SlotSortBy
ReadS [SlotSortBy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlotSortBy]
$creadListPrec :: ReadPrec [SlotSortBy]
readPrec :: ReadPrec SlotSortBy
$creadPrec :: ReadPrec SlotSortBy
readList :: ReadS [SlotSortBy]
$creadList :: ReadS [SlotSortBy]
readsPrec :: Int -> ReadS SlotSortBy
$creadsPrec :: Int -> ReadS SlotSortBy
Prelude.Read, Int -> SlotSortBy -> ShowS
[SlotSortBy] -> ShowS
SlotSortBy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlotSortBy] -> ShowS
$cshowList :: [SlotSortBy] -> ShowS
show :: SlotSortBy -> String
$cshow :: SlotSortBy -> String
showsPrec :: Int -> SlotSortBy -> ShowS
$cshowsPrec :: Int -> SlotSortBy -> ShowS
Prelude.Show, forall x. Rep SlotSortBy x -> SlotSortBy
forall x. SlotSortBy -> Rep SlotSortBy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SlotSortBy x -> SlotSortBy
$cfrom :: forall x. SlotSortBy -> Rep SlotSortBy x
Prelude.Generic)
newSlotSortBy ::
SlotSortAttribute ->
SortOrder ->
SlotSortBy
newSlotSortBy :: SlotSortAttribute -> SortOrder -> SlotSortBy
newSlotSortBy SlotSortAttribute
pAttribute_ SortOrder
pOrder_ =
SlotSortBy'
{ $sel:attribute:SlotSortBy' :: SlotSortAttribute
attribute = SlotSortAttribute
pAttribute_,
$sel:order:SlotSortBy' :: SortOrder
order = SortOrder
pOrder_
}
slotSortBy_attribute :: Lens.Lens' SlotSortBy SlotSortAttribute
slotSortBy_attribute :: Lens' SlotSortBy SlotSortAttribute
slotSortBy_attribute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotSortBy' {SlotSortAttribute
attribute :: SlotSortAttribute
$sel:attribute:SlotSortBy' :: SlotSortBy -> SlotSortAttribute
attribute} -> SlotSortAttribute
attribute) (\s :: SlotSortBy
s@SlotSortBy' {} SlotSortAttribute
a -> SlotSortBy
s {$sel:attribute:SlotSortBy' :: SlotSortAttribute
attribute = SlotSortAttribute
a} :: SlotSortBy)
slotSortBy_order :: Lens.Lens' SlotSortBy SortOrder
slotSortBy_order :: Lens' SlotSortBy SortOrder
slotSortBy_order = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotSortBy' {SortOrder
order :: SortOrder
$sel:order:SlotSortBy' :: SlotSortBy -> SortOrder
order} -> SortOrder
order) (\s :: SlotSortBy
s@SlotSortBy' {} SortOrder
a -> SlotSortBy
s {$sel:order:SlotSortBy' :: SortOrder
order = SortOrder
a} :: SlotSortBy)
instance Prelude.Hashable SlotSortBy where
hashWithSalt :: Int -> SlotSortBy -> Int
hashWithSalt Int
_salt SlotSortBy' {SlotSortAttribute
SortOrder
order :: SortOrder
attribute :: SlotSortAttribute
$sel:order:SlotSortBy' :: SlotSortBy -> SortOrder
$sel:attribute:SlotSortBy' :: SlotSortBy -> SlotSortAttribute
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SlotSortAttribute
attribute
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SortOrder
order
instance Prelude.NFData SlotSortBy where
rnf :: SlotSortBy -> ()
rnf SlotSortBy' {SlotSortAttribute
SortOrder
order :: SortOrder
attribute :: SlotSortAttribute
$sel:order:SlotSortBy' :: SlotSortBy -> SortOrder
$sel:attribute:SlotSortBy' :: SlotSortBy -> SlotSortAttribute
..} =
forall a. NFData a => a -> ()
Prelude.rnf SlotSortAttribute
attribute
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SortOrder
order
instance Data.ToJSON SlotSortBy where
toJSON :: SlotSortBy -> Value
toJSON SlotSortBy' {SlotSortAttribute
SortOrder
order :: SortOrder
attribute :: SlotSortAttribute
$sel:order:SlotSortBy' :: SlotSortBy -> SortOrder
$sel:attribute:SlotSortBy' :: SlotSortBy -> SlotSortAttribute
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"attribute" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SlotSortAttribute
attribute),
forall a. a -> Maybe a
Prelude.Just (Key
"order" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SortOrder
order)
]
)