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