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