-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSwitch.hs
30 lines (26 loc) · 895 Bytes
/
Switch.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
module Aitu.Bot.Forms.Content.Switch
( Switch(..)
)
where
import Data.Aeson hiding ( Options )
import Data.Text
import Aitu.Bot.Forms.Options ( Options )
import qualified Aitu.Bot.Forms.Content.Content
as Content
data Switch = Switch {
contentId :: Content.ContentID
, title :: Text
, defaultState :: Bool
, options :: Maybe Options
} deriving (Show)
instance ToJSON Switch where
toJSON Switch {..} = object
[ "id" .= contentId
, "type" .= Content.Switch
, "title" .= title
, "default_state" .= defaultState
, "options" .= options
]