diff options
Diffstat (limited to 'ddl/out/TestData.hs')
-rw-r--r-- | ddl/out/TestData.hs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/ddl/out/TestData.hs b/ddl/out/TestData.hs index a81134f..d6d8e38 100644 --- a/ddl/out/TestData.hs +++ b/ddl/out/TestData.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.109009000000Z | 2 | -- 2016-02-12T16:05:13.383716000000Z |
3 | 3 | ||
4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} | 4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} |
5 | module TestData where | 5 | module TestData where |
@@ -46,13 +46,21 @@ data Scene | |||
46 | 46 | ||
47 | deriving (Show, Eq, Ord) | 47 | deriving (Show, Eq, Ord) |
48 | 48 | ||
49 | data PipelineInfo | ||
50 | = PipelineInfo | ||
51 | { pipelineName :: String | ||
52 | , pipeline :: Pipeline | ||
53 | } | ||
54 | |||
55 | deriving (Show, Eq, Ord) | ||
56 | |||
49 | data RenderJob | 57 | data RenderJob |
50 | = RenderJob | 58 | = RenderJob |
51 | { meshes :: Vector Mesh | 59 | { meshes :: Vector Mesh |
52 | , textures :: Vector String | 60 | , textures :: Vector String |
53 | , schema :: PipelineSchema | 61 | , schema :: PipelineSchema |
54 | , scenes :: Vector Scene | 62 | , scenes :: Vector Scene |
55 | , pipelines :: Vector Pipeline | 63 | , pipelines :: Vector PipelineInfo |
56 | } | 64 | } |
57 | 65 | ||
58 | deriving (Show, Eq, Ord) | 66 | deriving (Show, Eq, Ord) |
@@ -144,6 +152,27 @@ instance FromJSON Scene where | |||
144 | } | 152 | } |
145 | parseJSON _ = mzero | 153 | parseJSON _ = mzero |
146 | 154 | ||
155 | instance ToJSON PipelineInfo where | ||
156 | toJSON v = case v of | ||
157 | PipelineInfo{..} -> object | ||
158 | [ "tag" .= ("PipelineInfo" :: Text) | ||
159 | , "pipelineName" .= pipelineName | ||
160 | , "pipeline" .= pipeline | ||
161 | ] | ||
162 | |||
163 | instance FromJSON PipelineInfo where | ||
164 | parseJSON (Object obj) = do | ||
165 | tag <- obj .: "tag" | ||
166 | case tag :: Text of | ||
167 | "PipelineInfo" -> do | ||
168 | pipelineName <- obj .: "pipelineName" | ||
169 | pipeline <- obj .: "pipeline" | ||
170 | pure $ PipelineInfo | ||
171 | { pipelineName = pipelineName | ||
172 | , pipeline = pipeline | ||
173 | } | ||
174 | parseJSON _ = mzero | ||
175 | |||
147 | instance ToJSON RenderJob where | 176 | instance ToJSON RenderJob where |
148 | toJSON v = case v of | 177 | toJSON v = case v of |
149 | RenderJob{..} -> object | 178 | RenderJob{..} -> object |