2 Module : Gargantext.API.Metrics
3 Description : Server API
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
14 {-# OPTIONS_GHC -fno-warn-orphans #-}
16 {-# LANGUAGE DataKinds #-}
17 {-# LANGUAGE DeriveGeneric #-}
18 {-# LANGUAGE FlexibleContexts #-}
19 {-# LANGUAGE NoImplicitPrelude #-}
20 {-# LANGUAGE OverloadedStrings #-}
21 {-# LANGUAGE RankNTypes #-}
22 {-# LANGUAGE TemplateHaskell #-}
23 {-# LANGUAGE TypeOperators #-}
25 module Gargantext.API.Metrics
28 import Data.Text (Text)
29 import GHC.Generics (Generic)
30 import Gargantext.Prelude
31 import Data.Aeson.TH (deriveJSON)
32 import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
33 import Gargantext.Core.Types (ListType(..))
34 import Gargantext.Core.Utils.Prefix (unPrefix)
38 data Metrics = Metrics
39 { metrics_data :: [Metric]}
40 deriving (Generic, Show)
42 instance ToSchema Metrics
43 instance Arbitrary Metrics
45 arbitrary = Metrics <$> arbitrary
52 } deriving (Generic, Show)
54 instance ToSchema Metric
55 instance Arbitrary Metric
57 arbitrary = Metric <$> arbitrary
62 deriveJSON (unPrefix "metrics_") ''Metrics
63 deriveJSON (unPrefix "m_") ''Metric