module TD.Query.LoadActiveStories
(LoadActiveStories(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.StoryList as StoryList
data LoadActiveStories
= LoadActiveStories
{ LoadActiveStories -> Maybe StoryList
story_list :: Maybe StoryList.StoryList
}
deriving (LoadActiveStories -> LoadActiveStories -> Bool
(LoadActiveStories -> LoadActiveStories -> Bool)
-> (LoadActiveStories -> LoadActiveStories -> Bool)
-> Eq LoadActiveStories
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LoadActiveStories -> LoadActiveStories -> Bool
== :: LoadActiveStories -> LoadActiveStories -> Bool
$c/= :: LoadActiveStories -> LoadActiveStories -> Bool
/= :: LoadActiveStories -> LoadActiveStories -> Bool
Eq, Int -> LoadActiveStories -> ShowS
[LoadActiveStories] -> ShowS
LoadActiveStories -> String
(Int -> LoadActiveStories -> ShowS)
-> (LoadActiveStories -> String)
-> ([LoadActiveStories] -> ShowS)
-> Show LoadActiveStories
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LoadActiveStories -> ShowS
showsPrec :: Int -> LoadActiveStories -> ShowS
$cshow :: LoadActiveStories -> String
show :: LoadActiveStories -> String
$cshowList :: [LoadActiveStories] -> ShowS
showList :: [LoadActiveStories] -> ShowS
Show)
instance I.ShortShow LoadActiveStories where
shortShow :: LoadActiveStories -> String
shortShow
LoadActiveStories
{ story_list :: LoadActiveStories -> Maybe StoryList
story_list = Maybe StoryList
story_list_
}
= String
"LoadActiveStories"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"story_list" String -> Maybe StoryList -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe StoryList
story_list_
]
instance AT.ToJSON LoadActiveStories where
toJSON :: LoadActiveStories -> Value
toJSON
LoadActiveStories
{ story_list :: LoadActiveStories -> Maybe StoryList
story_list = Maybe StoryList
story_list_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"loadActiveStories"
, Key
"story_list" Key -> Maybe StoryList -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe StoryList
story_list_
]