{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SlotDefaultValue = SlotDefaultValue'
{
SlotDefaultValue -> Text
defaultValue :: Prelude.Text
}
deriving (SlotDefaultValue -> SlotDefaultValue -> Bool
(SlotDefaultValue -> SlotDefaultValue -> Bool)
-> (SlotDefaultValue -> SlotDefaultValue -> Bool)
-> Eq SlotDefaultValue
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]
(Int -> ReadS SlotDefaultValue)
-> ReadS [SlotDefaultValue]
-> ReadPrec SlotDefaultValue
-> ReadPrec [SlotDefaultValue]
-> Read 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
(Int -> SlotDefaultValue -> ShowS)
-> (SlotDefaultValue -> String)
-> ([SlotDefaultValue] -> ShowS)
-> Show SlotDefaultValue
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. SlotDefaultValue -> Rep SlotDefaultValue x)
-> (forall x. Rep SlotDefaultValue x -> SlotDefaultValue)
-> Generic SlotDefaultValue
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' :: Text -> SlotDefaultValue
SlotDefaultValue' {$sel:defaultValue:SlotDefaultValue' :: Text
defaultValue = Text
pDefaultValue_}
slotDefaultValue_defaultValue :: Lens.Lens' SlotDefaultValue Prelude.Text
slotDefaultValue_defaultValue :: (Text -> f Text) -> SlotDefaultValue -> f SlotDefaultValue
slotDefaultValue_defaultValue = (SlotDefaultValue -> Text)
-> (SlotDefaultValue -> Text -> SlotDefaultValue)
-> Lens SlotDefaultValue SlotDefaultValue Text Text
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 Core.FromJSON SlotDefaultValue where
parseJSON :: Value -> Parser SlotDefaultValue
parseJSON =
String
-> (Object -> Parser SlotDefaultValue)
-> Value
-> Parser SlotDefaultValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SlotDefaultValue"
( \Object
x ->
Text -> SlotDefaultValue
SlotDefaultValue'
(Text -> SlotDefaultValue)
-> Parser Text -> Parser SlotDefaultValue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"defaultValue")
)
instance Prelude.Hashable SlotDefaultValue
instance Prelude.NFData SlotDefaultValue
instance Core.ToJSON SlotDefaultValue where
toJSON :: SlotDefaultValue -> Value
toJSON SlotDefaultValue' {Text
defaultValue :: Text
$sel:defaultValue:SlotDefaultValue' :: SlotDefaultValue -> Text
..} =
[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
"defaultValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
defaultValue)]
)