{-# 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.SampleUtterance where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SampleUtterance = SampleUtterance'
{
SampleUtterance -> Text
utterance :: Prelude.Text
}
deriving (SampleUtterance -> SampleUtterance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SampleUtterance -> SampleUtterance -> Bool
$c/= :: SampleUtterance -> SampleUtterance -> Bool
== :: SampleUtterance -> SampleUtterance -> Bool
$c== :: SampleUtterance -> SampleUtterance -> Bool
Prelude.Eq, ReadPrec [SampleUtterance]
ReadPrec SampleUtterance
Int -> ReadS SampleUtterance
ReadS [SampleUtterance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SampleUtterance]
$creadListPrec :: ReadPrec [SampleUtterance]
readPrec :: ReadPrec SampleUtterance
$creadPrec :: ReadPrec SampleUtterance
readList :: ReadS [SampleUtterance]
$creadList :: ReadS [SampleUtterance]
readsPrec :: Int -> ReadS SampleUtterance
$creadsPrec :: Int -> ReadS SampleUtterance
Prelude.Read, Int -> SampleUtterance -> ShowS
[SampleUtterance] -> ShowS
SampleUtterance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SampleUtterance] -> ShowS
$cshowList :: [SampleUtterance] -> ShowS
show :: SampleUtterance -> String
$cshow :: SampleUtterance -> String
showsPrec :: Int -> SampleUtterance -> ShowS
$cshowsPrec :: Int -> SampleUtterance -> ShowS
Prelude.Show, forall x. Rep SampleUtterance x -> SampleUtterance
forall x. SampleUtterance -> Rep SampleUtterance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SampleUtterance x -> SampleUtterance
$cfrom :: forall x. SampleUtterance -> Rep SampleUtterance x
Prelude.Generic)
newSampleUtterance ::
Prelude.Text ->
SampleUtterance
newSampleUtterance :: Text -> SampleUtterance
newSampleUtterance Text
pUtterance_ =
SampleUtterance' {$sel:utterance:SampleUtterance' :: Text
utterance = Text
pUtterance_}
sampleUtterance_utterance :: Lens.Lens' SampleUtterance Prelude.Text
sampleUtterance_utterance :: Lens' SampleUtterance Text
sampleUtterance_utterance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SampleUtterance' {Text
utterance :: Text
$sel:utterance:SampleUtterance' :: SampleUtterance -> Text
utterance} -> Text
utterance) (\s :: SampleUtterance
s@SampleUtterance' {} Text
a -> SampleUtterance
s {$sel:utterance:SampleUtterance' :: Text
utterance = Text
a} :: SampleUtterance)
instance Data.FromJSON SampleUtterance where
parseJSON :: Value -> Parser SampleUtterance
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SampleUtterance"
( \Object
x ->
Text -> SampleUtterance
SampleUtterance' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"utterance")
)
instance Prelude.Hashable SampleUtterance where
hashWithSalt :: Int -> SampleUtterance -> Int
hashWithSalt Int
_salt SampleUtterance' {Text
utterance :: Text
$sel:utterance:SampleUtterance' :: SampleUtterance -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
utterance
instance Prelude.NFData SampleUtterance where
rnf :: SampleUtterance -> ()
rnf SampleUtterance' {Text
utterance :: Text
$sel:utterance:SampleUtterance' :: SampleUtterance -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
utterance
instance Data.ToJSON SampleUtterance where
toJSON :: SampleUtterance -> Value
toJSON SampleUtterance' {Text
utterance :: Text
$sel:utterance:SampleUtterance' :: SampleUtterance -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"utterance" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
utterance)]
)