{-# 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.LexRuntime.Types.Button where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Button = Button'
{
Button -> Text
text :: Prelude.Text,
Button -> Text
value :: Prelude.Text
}
deriving (Button -> Button -> Bool
(Button -> Button -> Bool)
-> (Button -> Button -> Bool) -> Eq Button
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Button -> Button -> Bool
$c/= :: Button -> Button -> Bool
== :: Button -> Button -> Bool
$c== :: Button -> Button -> Bool
Prelude.Eq, ReadPrec [Button]
ReadPrec Button
Int -> ReadS Button
ReadS [Button]
(Int -> ReadS Button)
-> ReadS [Button]
-> ReadPrec Button
-> ReadPrec [Button]
-> Read Button
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Button]
$creadListPrec :: ReadPrec [Button]
readPrec :: ReadPrec Button
$creadPrec :: ReadPrec Button
readList :: ReadS [Button]
$creadList :: ReadS [Button]
readsPrec :: Int -> ReadS Button
$creadsPrec :: Int -> ReadS Button
Prelude.Read, Int -> Button -> ShowS
[Button] -> ShowS
Button -> String
(Int -> Button -> ShowS)
-> (Button -> String) -> ([Button] -> ShowS) -> Show Button
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Button] -> ShowS
$cshowList :: [Button] -> ShowS
show :: Button -> String
$cshow :: Button -> String
showsPrec :: Int -> Button -> ShowS
$cshowsPrec :: Int -> Button -> ShowS
Prelude.Show, (forall x. Button -> Rep Button x)
-> (forall x. Rep Button x -> Button) -> Generic Button
forall x. Rep Button x -> Button
forall x. Button -> Rep Button x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Button x -> Button
$cfrom :: forall x. Button -> Rep Button x
Prelude.Generic)
newButton ::
Prelude.Text ->
Prelude.Text ->
Button
newButton :: Text -> Text -> Button
newButton Text
pText_ Text
pValue_ =
Button' :: Text -> Text -> Button
Button' {$sel:text:Button' :: Text
text = Text
pText_, $sel:value:Button' :: Text
value = Text
pValue_}
button_text :: Lens.Lens' Button Prelude.Text
button_text :: (Text -> f Text) -> Button -> f Button
button_text = (Button -> Text)
-> (Button -> Text -> Button) -> Lens Button Button Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Button' {Text
text :: Text
$sel:text:Button' :: Button -> Text
text} -> Text
text) (\s :: Button
s@Button' {} Text
a -> Button
s {$sel:text:Button' :: Text
text = Text
a} :: Button)
button_value :: Lens.Lens' Button Prelude.Text
button_value :: (Text -> f Text) -> Button -> f Button
button_value = (Button -> Text)
-> (Button -> Text -> Button) -> Lens Button Button Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Button' {Text
value :: Text
$sel:value:Button' :: Button -> Text
value} -> Text
value) (\s :: Button
s@Button' {} Text
a -> Button
s {$sel:value:Button' :: Text
value = Text
a} :: Button)
instance Core.FromJSON Button where
parseJSON :: Value -> Parser Button
parseJSON =
String -> (Object -> Parser Button) -> Value -> Parser Button
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Button"
( \Object
x ->
Text -> Text -> Button
Button'
(Text -> Text -> Button) -> Parser Text -> Parser (Text -> Button)
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
"text") Parser (Text -> Button) -> Parser Text -> Parser Button
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"value")
)
instance Prelude.Hashable Button
instance Prelude.NFData Button