-- |
-- Module: PowerDNS.API.Servers
-- Description: Servers endpoints for PowerDNS API
--
-- This module implements the endpoints described at [Servers API](https://doc.powerdns.com/authoritative/http-api/server.html)

{-# LANGUAGE DataKinds          #-}
{-# LANGUAGE DeriveAnyClass     #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE TypeOperators      #-}
{-# LANGUAGE OverloadedStrings  #-}
module PowerDNS.API.Servers
  (
  -- * API
    ServersAPI(..)

  -- * Data types
  , Server(..)
  , ObjectType(..)
  , SearchResult(..)
  , CacheFlushResult(..)
  , AnyStatisticItem(..)
  , StatisticItem(..)
  , MapStatisticItem(..)
  , RingStatisticItem(..)
  , SimpleStatisticItem(..)
  )
where


import           Data.Char (toLower)
import           Data.Data (Data)
import           Text.Read (readMaybe)

import           Control.DeepSeq (NFData)
import           Data.Aeson (FromJSON(..), ToJSON(..), defaultOptions
                            , Value(String)
                            , fieldLabelModifier, genericParseJSON
                            , allNullaryToStringTag
                            , genericToJSON
                            , (.:), (.=)
                            , withObject, object
                            )
import           Data.Aeson.Types (Parser)
import qualified Data.Text as T
import           Servant.API
import           Servant.API.Generic

import           PowerDNS.Internal.Utils (Empty(..), strip)

----------------------------------------------------------------------------------------

type QueryParamReq = QueryParam' [Required, Strict]
data ServersAPI f = ServersAPI
  { ServersAPI f -> f :- ("servers" :> Get '[JSON] [Server])
apiListServers :: f :- "servers"
                        :> Get '[JSON] [Server]

  , ServersAPI f
-> f
   :- ("servers" :> (Capture "server_id" Text :> Get '[JSON] Server))
apiGetServer   :: f :- "servers" :> Capture "server_id" T.Text
                        :> Get '[JSON] Server

  , ServersAPI f
-> f
   :- ("servers"
       :> (Capture "server_id" Text
           :> ("search-data"
               :> (QueryParamReq "q" Text
                   :> (QueryParamReq "max" Integer
                       :> (QueryParam "object_type" ObjectType
                           :> Get '[JSON] [SearchResult]))))))
apiSearch      :: f :- "servers" :> Capture "server_id" T.Text :> "search-data"
                        :> QueryParamReq "q" T.Text
                        :> QueryParamReq "max" Integer
                        :> QueryParam "object_type" ObjectType
                        :> Get '[JSON] [SearchResult]

  , ServersAPI f
-> f
   :- ("servers"
       :> (Capture "server_id" Text
           :> (QueryParamReq "domain" Text :> Put '[JSON] CacheFlushResult)))
apiFlushCache  :: f :- "servers" :> Capture "server_id" T.Text
                        :> QueryParamReq "domain" T.Text
                        :> Put '[JSON] CacheFlushResult

  , ServersAPI f
-> f
   :- ("servers"
       :> (Capture "server_id" Text
           :> ("statistics"
               :> (QueryParam "statistic" Text
                   :> (QueryParam "includerings" Bool
                       :> Get '[JSON] [AnyStatisticItem])))))
apiStatistics  :: f :- "servers" :> Capture "server_id" T.Text :> "statistics"
                        :> QueryParam "statistic" T.Text
                        :> QueryParam "includerings" Bool
                        :> Get '[JSON] [AnyStatisticItem]
  } deriving (forall x. ServersAPI f -> Rep (ServersAPI f) x)
-> (forall x. Rep (ServersAPI f) x -> ServersAPI f)
-> Generic (ServersAPI f)
forall x. Rep (ServersAPI f) x -> ServersAPI f
forall x. ServersAPI f -> Rep (ServersAPI f) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall f x. Rep (ServersAPI f) x -> ServersAPI f
forall f x. ServersAPI f -> Rep (ServersAPI f) x
$cto :: forall f x. Rep (ServersAPI f) x -> ServersAPI f
$cfrom :: forall f x. ServersAPI f -> Rep (ServersAPI f) x
Generic

----------------------------------------------------------------------------------------

data Server = Server
  { Server -> Maybe Text
server_type :: Maybe T.Text
  , Server -> Maybe Text
server_id :: Maybe T.Text
  , Server -> Maybe Text
server_daemon_type :: Maybe T.Text
  , Server -> Maybe Text
server_version :: Maybe T.Text
  , Server -> Maybe Text
server_url :: Maybe T.Text
  , Server -> Maybe Text
server_config_url :: Maybe T.Text
  , Server -> Maybe Text
server_zones_url :: Maybe T.Text
  } deriving (Server -> Server -> Bool
(Server -> Server -> Bool)
-> (Server -> Server -> Bool) -> Eq Server
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Server -> Server -> Bool
$c/= :: Server -> Server -> Bool
== :: Server -> Server -> Bool
$c== :: Server -> Server -> Bool
Eq, Eq Server
Eq Server =>
(Server -> Server -> Ordering)
-> (Server -> Server -> Bool)
-> (Server -> Server -> Bool)
-> (Server -> Server -> Bool)
-> (Server -> Server -> Bool)
-> (Server -> Server -> Server)
-> (Server -> Server -> Server)
-> Ord Server
Server -> Server -> Bool
Server -> Server -> Ordering
Server -> Server -> Server
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Server -> Server -> Server
$cmin :: Server -> Server -> Server
max :: Server -> Server -> Server
$cmax :: Server -> Server -> Server
>= :: Server -> Server -> Bool
$c>= :: Server -> Server -> Bool
> :: Server -> Server -> Bool
$c> :: Server -> Server -> Bool
<= :: Server -> Server -> Bool
$c<= :: Server -> Server -> Bool
< :: Server -> Server -> Bool
$c< :: Server -> Server -> Bool
compare :: Server -> Server -> Ordering
$ccompare :: Server -> Server -> Ordering
$cp1Ord :: Eq Server
Ord, Int -> Server -> ShowS
[Server] -> ShowS
Server -> String
(Int -> Server -> ShowS)
-> (Server -> String) -> ([Server] -> ShowS) -> Show Server
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Server] -> ShowS
$cshowList :: [Server] -> ShowS
show :: Server -> String
$cshow :: Server -> String
showsPrec :: Int -> Server -> ShowS
$cshowsPrec :: Int -> Server -> ShowS
Show, (forall x. Server -> Rep Server x)
-> (forall x. Rep Server x -> Server) -> Generic Server
forall x. Rep Server x -> Server
forall x. Server -> Rep Server x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Server x -> Server
$cfrom :: forall x. Server -> Rep Server x
Generic, Server -> ()
(Server -> ()) -> NFData Server
forall a. (a -> ()) -> NFData a
rnf :: Server -> ()
$crnf :: Server -> ()
NFData, Typeable Server
DataType
Constr
Typeable Server =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Server -> c Server)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Server)
-> (Server -> Constr)
-> (Server -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Server))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Server))
-> ((forall b. Data b => b -> b) -> Server -> Server)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Server -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Server -> r)
-> (forall u. (forall d. Data d => d -> u) -> Server -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Server -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Server -> m Server)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Server -> m Server)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Server -> m Server)
-> Data Server
Server -> DataType
Server -> Constr
(forall b. Data b => b -> b) -> Server -> Server
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Server -> c Server
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Server
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Server -> u
forall u. (forall d. Data d => d -> u) -> Server -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Server -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Server -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Server -> m Server
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Server -> m Server
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Server
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Server -> c Server
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Server)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Server)
$cServer :: Constr
$tServer :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Server -> m Server
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Server -> m Server
gmapMp :: (forall d. Data d => d -> m d) -> Server -> m Server
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Server -> m Server
gmapM :: (forall d. Data d => d -> m d) -> Server -> m Server
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Server -> m Server
gmapQi :: Int -> (forall d. Data d => d -> u) -> Server -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Server -> u
gmapQ :: (forall d. Data d => d -> u) -> Server -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Server -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Server -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Server -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Server -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Server -> r
gmapT :: (forall b. Data b => b -> b) -> Server -> Server
$cgmapT :: (forall b. Data b => b -> b) -> Server -> Server
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Server)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Server)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Server)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Server)
dataTypeOf :: Server -> DataType
$cdataTypeOf :: Server -> DataType
toConstr :: Server -> Constr
$ctoConstr :: Server -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Server
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Server
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Server -> c Server
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Server -> c Server
$cp1Data :: Typeable Server
Data, Server
Server -> Empty Server
forall a. a -> Empty a
empty :: Server
$cempty :: Server
Empty)

instance ToJSON Server where
  toJSON :: Server -> Value
toJSON = Options -> Server -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "server_"}

instance FromJSON Server where
  parseJSON :: Value -> Parser Server
parseJSON = Options -> Value -> Parser Server
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "server_"}

----------------------------------------------------------------------------------------

data SearchResult = SearchResult
  { SearchResult -> Text
sr_content :: T.Text
  , SearchResult -> Bool
sr_disabled :: Bool
  , SearchResult -> Text
sr_name :: T.Text
  , SearchResult -> ObjectType
sr_object_type :: ObjectType
  , SearchResult -> Text
sr_zone_id :: T.Text
  , SearchResult -> Text
sr_zone :: T.Text
  , SearchResult -> Text
sr_type :: T.Text
  , SearchResult -> Integer
sr_ttl :: Integer
  } deriving (SearchResult -> SearchResult -> Bool
(SearchResult -> SearchResult -> Bool)
-> (SearchResult -> SearchResult -> Bool) -> Eq SearchResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchResult -> SearchResult -> Bool
$c/= :: SearchResult -> SearchResult -> Bool
== :: SearchResult -> SearchResult -> Bool
$c== :: SearchResult -> SearchResult -> Bool
Eq, Eq SearchResult
Eq SearchResult =>
(SearchResult -> SearchResult -> Ordering)
-> (SearchResult -> SearchResult -> Bool)
-> (SearchResult -> SearchResult -> Bool)
-> (SearchResult -> SearchResult -> Bool)
-> (SearchResult -> SearchResult -> Bool)
-> (SearchResult -> SearchResult -> SearchResult)
-> (SearchResult -> SearchResult -> SearchResult)
-> Ord SearchResult
SearchResult -> SearchResult -> Bool
SearchResult -> SearchResult -> Ordering
SearchResult -> SearchResult -> SearchResult
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SearchResult -> SearchResult -> SearchResult
$cmin :: SearchResult -> SearchResult -> SearchResult
max :: SearchResult -> SearchResult -> SearchResult
$cmax :: SearchResult -> SearchResult -> SearchResult
>= :: SearchResult -> SearchResult -> Bool
$c>= :: SearchResult -> SearchResult -> Bool
> :: SearchResult -> SearchResult -> Bool
$c> :: SearchResult -> SearchResult -> Bool
<= :: SearchResult -> SearchResult -> Bool
$c<= :: SearchResult -> SearchResult -> Bool
< :: SearchResult -> SearchResult -> Bool
$c< :: SearchResult -> SearchResult -> Bool
compare :: SearchResult -> SearchResult -> Ordering
$ccompare :: SearchResult -> SearchResult -> Ordering
$cp1Ord :: Eq SearchResult
Ord, Int -> SearchResult -> ShowS
[SearchResult] -> ShowS
SearchResult -> String
(Int -> SearchResult -> ShowS)
-> (SearchResult -> String)
-> ([SearchResult] -> ShowS)
-> Show SearchResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchResult] -> ShowS
$cshowList :: [SearchResult] -> ShowS
show :: SearchResult -> String
$cshow :: SearchResult -> String
showsPrec :: Int -> SearchResult -> ShowS
$cshowsPrec :: Int -> SearchResult -> ShowS
Show, (forall x. SearchResult -> Rep SearchResult x)
-> (forall x. Rep SearchResult x -> SearchResult)
-> Generic SearchResult
forall x. Rep SearchResult x -> SearchResult
forall x. SearchResult -> Rep SearchResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchResult x -> SearchResult
$cfrom :: forall x. SearchResult -> Rep SearchResult x
Generic, SearchResult -> ()
(SearchResult -> ()) -> NFData SearchResult
forall a. (a -> ()) -> NFData a
rnf :: SearchResult -> ()
$crnf :: SearchResult -> ()
NFData, Typeable SearchResult
DataType
Constr
Typeable SearchResult =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> SearchResult -> c SearchResult)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SearchResult)
-> (SearchResult -> Constr)
-> (SearchResult -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SearchResult))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SearchResult))
-> ((forall b. Data b => b -> b) -> SearchResult -> SearchResult)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SearchResult -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SearchResult -> r)
-> (forall u. (forall d. Data d => d -> u) -> SearchResult -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SearchResult -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SearchResult -> m SearchResult)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SearchResult -> m SearchResult)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SearchResult -> m SearchResult)
-> Data SearchResult
SearchResult -> DataType
SearchResult -> Constr
(forall b. Data b => b -> b) -> SearchResult -> SearchResult
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SearchResult -> c SearchResult
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SearchResult
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> SearchResult -> u
forall u. (forall d. Data d => d -> u) -> SearchResult -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SearchResult -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SearchResult -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SearchResult
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SearchResult -> c SearchResult
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SearchResult)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SearchResult)
$cSearchResult :: Constr
$tSearchResult :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
gmapMp :: (forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
gmapM :: (forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SearchResult -> m SearchResult
gmapQi :: Int -> (forall d. Data d => d -> u) -> SearchResult -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SearchResult -> u
gmapQ :: (forall d. Data d => d -> u) -> SearchResult -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SearchResult -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SearchResult -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SearchResult -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SearchResult -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SearchResult -> r
gmapT :: (forall b. Data b => b -> b) -> SearchResult -> SearchResult
$cgmapT :: (forall b. Data b => b -> b) -> SearchResult -> SearchResult
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SearchResult)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SearchResult)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SearchResult)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SearchResult)
dataTypeOf :: SearchResult -> DataType
$cdataTypeOf :: SearchResult -> DataType
toConstr :: SearchResult -> Constr
$ctoConstr :: SearchResult -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SearchResult
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SearchResult
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SearchResult -> c SearchResult
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SearchResult -> c SearchResult
$cp1Data :: Typeable SearchResult
Data)

instance ToJSON SearchResult where
  toJSON :: SearchResult -> Value
toJSON = Options -> SearchResult -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "sr_"}

instance FromJSON SearchResult where
  parseJSON :: Value -> Parser SearchResult
parseJSON = Options -> Value -> Parser SearchResult
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "sr_"}

----------------------------------------------------------------------------------------
data ObjectType = TyAll
                | TyZone
                | TyRecord
                | TyComment
                deriving (ObjectType -> ObjectType -> Bool
(ObjectType -> ObjectType -> Bool)
-> (ObjectType -> ObjectType -> Bool) -> Eq ObjectType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectType -> ObjectType -> Bool
$c/= :: ObjectType -> ObjectType -> Bool
== :: ObjectType -> ObjectType -> Bool
$c== :: ObjectType -> ObjectType -> Bool
Eq, Eq ObjectType
Eq ObjectType =>
(ObjectType -> ObjectType -> Ordering)
-> (ObjectType -> ObjectType -> Bool)
-> (ObjectType -> ObjectType -> Bool)
-> (ObjectType -> ObjectType -> Bool)
-> (ObjectType -> ObjectType -> Bool)
-> (ObjectType -> ObjectType -> ObjectType)
-> (ObjectType -> ObjectType -> ObjectType)
-> Ord ObjectType
ObjectType -> ObjectType -> Bool
ObjectType -> ObjectType -> Ordering
ObjectType -> ObjectType -> ObjectType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ObjectType -> ObjectType -> ObjectType
$cmin :: ObjectType -> ObjectType -> ObjectType
max :: ObjectType -> ObjectType -> ObjectType
$cmax :: ObjectType -> ObjectType -> ObjectType
>= :: ObjectType -> ObjectType -> Bool
$c>= :: ObjectType -> ObjectType -> Bool
> :: ObjectType -> ObjectType -> Bool
$c> :: ObjectType -> ObjectType -> Bool
<= :: ObjectType -> ObjectType -> Bool
$c<= :: ObjectType -> ObjectType -> Bool
< :: ObjectType -> ObjectType -> Bool
$c< :: ObjectType -> ObjectType -> Bool
compare :: ObjectType -> ObjectType -> Ordering
$ccompare :: ObjectType -> ObjectType -> Ordering
$cp1Ord :: Eq ObjectType
Ord, Int -> ObjectType -> ShowS
[ObjectType] -> ShowS
ObjectType -> String
(Int -> ObjectType -> ShowS)
-> (ObjectType -> String)
-> ([ObjectType] -> ShowS)
-> Show ObjectType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectType] -> ShowS
$cshowList :: [ObjectType] -> ShowS
show :: ObjectType -> String
$cshow :: ObjectType -> String
showsPrec :: Int -> ObjectType -> ShowS
$cshowsPrec :: Int -> ObjectType -> ShowS
Show, (forall x. ObjectType -> Rep ObjectType x)
-> (forall x. Rep ObjectType x -> ObjectType) -> Generic ObjectType
forall x. Rep ObjectType x -> ObjectType
forall x. ObjectType -> Rep ObjectType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ObjectType x -> ObjectType
$cfrom :: forall x. ObjectType -> Rep ObjectType x
Generic, ObjectType -> ()
(ObjectType -> ()) -> NFData ObjectType
forall a. (a -> ()) -> NFData a
rnf :: ObjectType -> ()
$crnf :: ObjectType -> ()
NFData, Typeable ObjectType
DataType
Constr
Typeable ObjectType =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> ObjectType -> c ObjectType)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ObjectType)
-> (ObjectType -> Constr)
-> (ObjectType -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ObjectType))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ObjectType))
-> ((forall b. Data b => b -> b) -> ObjectType -> ObjectType)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ObjectType -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ObjectType -> r)
-> (forall u. (forall d. Data d => d -> u) -> ObjectType -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ObjectType -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType)
-> Data ObjectType
ObjectType -> DataType
ObjectType -> Constr
(forall b. Data b => b -> b) -> ObjectType -> ObjectType
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ObjectType -> c ObjectType
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ObjectType
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ObjectType -> u
forall u. (forall d. Data d => d -> u) -> ObjectType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ObjectType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ObjectType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ObjectType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ObjectType -> c ObjectType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ObjectType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ObjectType)
$cTyComment :: Constr
$cTyRecord :: Constr
$cTyZone :: Constr
$cTyAll :: Constr
$tObjectType :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
gmapMp :: (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
gmapM :: (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ObjectType -> m ObjectType
gmapQi :: Int -> (forall d. Data d => d -> u) -> ObjectType -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ObjectType -> u
gmapQ :: (forall d. Data d => d -> u) -> ObjectType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ObjectType -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ObjectType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ObjectType -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ObjectType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ObjectType -> r
gmapT :: (forall b. Data b => b -> b) -> ObjectType -> ObjectType
$cgmapT :: (forall b. Data b => b -> b) -> ObjectType -> ObjectType
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ObjectType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ObjectType)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ObjectType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ObjectType)
dataTypeOf :: ObjectType -> DataType
$cdataTypeOf :: ObjectType -> DataType
toConstr :: ObjectType -> Constr
$ctoConstr :: ObjectType -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ObjectType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ObjectType
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ObjectType -> c ObjectType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ObjectType -> c ObjectType
$cp1Data :: Typeable ObjectType
Data)

instance ToJSON ObjectType where
  toJSON :: ObjectType -> Value
toJSON = Options -> ObjectType -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = (Char -> Char) -> ShowS
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Char -> Char
toLower ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "Ty"
                                        , allNullaryToStringTag :: Bool
allNullaryToStringTag = Bool
True }

instance FromJSON ObjectType where
  parseJSON :: Value -> Parser ObjectType
parseJSON = Options -> Value -> Parser ObjectType
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = (Char -> Char) -> ShowS
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Char -> Char
toLower ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "Ty"
                                              , allNullaryToStringTag :: Bool
allNullaryToStringTag = Bool
True }

instance ToHttpApiData ObjectType where
  toQueryParam :: ObjectType -> Text
toQueryParam TyAll = "all"
  toQueryParam TyZone = "zone"
  toQueryParam TyRecord = "all"
  toQueryParam TyComment = "comment"

----------------------------------------------------------------------------------------

data CacheFlushResult = CacheFlushResult
  { CacheFlushResult -> Integer
cfr_count :: Integer
  , CacheFlushResult -> Text
cfr_result :: T.Text
  } deriving (CacheFlushResult -> CacheFlushResult -> Bool
(CacheFlushResult -> CacheFlushResult -> Bool)
-> (CacheFlushResult -> CacheFlushResult -> Bool)
-> Eq CacheFlushResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheFlushResult -> CacheFlushResult -> Bool
$c/= :: CacheFlushResult -> CacheFlushResult -> Bool
== :: CacheFlushResult -> CacheFlushResult -> Bool
$c== :: CacheFlushResult -> CacheFlushResult -> Bool
Eq, Eq CacheFlushResult
Eq CacheFlushResult =>
(CacheFlushResult -> CacheFlushResult -> Ordering)
-> (CacheFlushResult -> CacheFlushResult -> Bool)
-> (CacheFlushResult -> CacheFlushResult -> Bool)
-> (CacheFlushResult -> CacheFlushResult -> Bool)
-> (CacheFlushResult -> CacheFlushResult -> Bool)
-> (CacheFlushResult -> CacheFlushResult -> CacheFlushResult)
-> (CacheFlushResult -> CacheFlushResult -> CacheFlushResult)
-> Ord CacheFlushResult
CacheFlushResult -> CacheFlushResult -> Bool
CacheFlushResult -> CacheFlushResult -> Ordering
CacheFlushResult -> CacheFlushResult -> CacheFlushResult
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CacheFlushResult -> CacheFlushResult -> CacheFlushResult
$cmin :: CacheFlushResult -> CacheFlushResult -> CacheFlushResult
max :: CacheFlushResult -> CacheFlushResult -> CacheFlushResult
$cmax :: CacheFlushResult -> CacheFlushResult -> CacheFlushResult
>= :: CacheFlushResult -> CacheFlushResult -> Bool
$c>= :: CacheFlushResult -> CacheFlushResult -> Bool
> :: CacheFlushResult -> CacheFlushResult -> Bool
$c> :: CacheFlushResult -> CacheFlushResult -> Bool
<= :: CacheFlushResult -> CacheFlushResult -> Bool
$c<= :: CacheFlushResult -> CacheFlushResult -> Bool
< :: CacheFlushResult -> CacheFlushResult -> Bool
$c< :: CacheFlushResult -> CacheFlushResult -> Bool
compare :: CacheFlushResult -> CacheFlushResult -> Ordering
$ccompare :: CacheFlushResult -> CacheFlushResult -> Ordering
$cp1Ord :: Eq CacheFlushResult
Ord, Int -> CacheFlushResult -> ShowS
[CacheFlushResult] -> ShowS
CacheFlushResult -> String
(Int -> CacheFlushResult -> ShowS)
-> (CacheFlushResult -> String)
-> ([CacheFlushResult] -> ShowS)
-> Show CacheFlushResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheFlushResult] -> ShowS
$cshowList :: [CacheFlushResult] -> ShowS
show :: CacheFlushResult -> String
$cshow :: CacheFlushResult -> String
showsPrec :: Int -> CacheFlushResult -> ShowS
$cshowsPrec :: Int -> CacheFlushResult -> ShowS
Show, (forall x. CacheFlushResult -> Rep CacheFlushResult x)
-> (forall x. Rep CacheFlushResult x -> CacheFlushResult)
-> Generic CacheFlushResult
forall x. Rep CacheFlushResult x -> CacheFlushResult
forall x. CacheFlushResult -> Rep CacheFlushResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CacheFlushResult x -> CacheFlushResult
$cfrom :: forall x. CacheFlushResult -> Rep CacheFlushResult x
Generic, CacheFlushResult -> ()
(CacheFlushResult -> ()) -> NFData CacheFlushResult
forall a. (a -> ()) -> NFData a
rnf :: CacheFlushResult -> ()
$crnf :: CacheFlushResult -> ()
NFData, Typeable CacheFlushResult
DataType
Constr
Typeable CacheFlushResult =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> CacheFlushResult -> c CacheFlushResult)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CacheFlushResult)
-> (CacheFlushResult -> Constr)
-> (CacheFlushResult -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CacheFlushResult))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c CacheFlushResult))
-> ((forall b. Data b => b -> b)
    -> CacheFlushResult -> CacheFlushResult)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> CacheFlushResult -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> CacheFlushResult -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> CacheFlushResult -> m CacheFlushResult)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> CacheFlushResult -> m CacheFlushResult)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> CacheFlushResult -> m CacheFlushResult)
-> Data CacheFlushResult
CacheFlushResult -> DataType
CacheFlushResult -> Constr
(forall b. Data b => b -> b)
-> CacheFlushResult -> CacheFlushResult
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CacheFlushResult -> c CacheFlushResult
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CacheFlushResult
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> CacheFlushResult -> u
forall u. (forall d. Data d => d -> u) -> CacheFlushResult -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CacheFlushResult
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CacheFlushResult -> c CacheFlushResult
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CacheFlushResult)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CacheFlushResult)
$cCacheFlushResult :: Constr
$tCacheFlushResult :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
gmapMp :: (forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
gmapM :: (forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CacheFlushResult -> m CacheFlushResult
gmapQi :: Int -> (forall d. Data d => d -> u) -> CacheFlushResult -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CacheFlushResult -> u
gmapQ :: (forall d. Data d => d -> u) -> CacheFlushResult -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CacheFlushResult -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CacheFlushResult -> r
gmapT :: (forall b. Data b => b -> b)
-> CacheFlushResult -> CacheFlushResult
$cgmapT :: (forall b. Data b => b -> b)
-> CacheFlushResult -> CacheFlushResult
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CacheFlushResult)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CacheFlushResult)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CacheFlushResult)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CacheFlushResult)
dataTypeOf :: CacheFlushResult -> DataType
$cdataTypeOf :: CacheFlushResult -> DataType
toConstr :: CacheFlushResult -> Constr
$ctoConstr :: CacheFlushResult -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CacheFlushResult
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CacheFlushResult
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CacheFlushResult -> c CacheFlushResult
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CacheFlushResult -> c CacheFlushResult
$cp1Data :: Typeable CacheFlushResult
Data)

instance ToJSON CacheFlushResult where
  toJSON :: CacheFlushResult -> Value
toJSON = Options -> CacheFlushResult -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "cfr_"}

instance FromJSON CacheFlushResult where
  parseJSON :: Value -> Parser CacheFlushResult
parseJSON = Options -> Value -> Parser CacheFlushResult
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "cfr_"}

----------------------------------------------------------------------------------------

data AnyStatisticItem = AnyStatisticItem StatisticItem
                       | AnyMapStatisticItem MapStatisticItem
                       | AnyRingStatisticItem RingStatisticItem
                       deriving (AnyStatisticItem -> AnyStatisticItem -> Bool
(AnyStatisticItem -> AnyStatisticItem -> Bool)
-> (AnyStatisticItem -> AnyStatisticItem -> Bool)
-> Eq AnyStatisticItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnyStatisticItem -> AnyStatisticItem -> Bool
$c/= :: AnyStatisticItem -> AnyStatisticItem -> Bool
== :: AnyStatisticItem -> AnyStatisticItem -> Bool
$c== :: AnyStatisticItem -> AnyStatisticItem -> Bool
Eq, Eq AnyStatisticItem
Eq AnyStatisticItem =>
(AnyStatisticItem -> AnyStatisticItem -> Ordering)
-> (AnyStatisticItem -> AnyStatisticItem -> Bool)
-> (AnyStatisticItem -> AnyStatisticItem -> Bool)
-> (AnyStatisticItem -> AnyStatisticItem -> Bool)
-> (AnyStatisticItem -> AnyStatisticItem -> Bool)
-> (AnyStatisticItem -> AnyStatisticItem -> AnyStatisticItem)
-> (AnyStatisticItem -> AnyStatisticItem -> AnyStatisticItem)
-> Ord AnyStatisticItem
AnyStatisticItem -> AnyStatisticItem -> Bool
AnyStatisticItem -> AnyStatisticItem -> Ordering
AnyStatisticItem -> AnyStatisticItem -> AnyStatisticItem
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AnyStatisticItem -> AnyStatisticItem -> AnyStatisticItem
$cmin :: AnyStatisticItem -> AnyStatisticItem -> AnyStatisticItem
max :: AnyStatisticItem -> AnyStatisticItem -> AnyStatisticItem
$cmax :: AnyStatisticItem -> AnyStatisticItem -> AnyStatisticItem
>= :: AnyStatisticItem -> AnyStatisticItem -> Bool
$c>= :: AnyStatisticItem -> AnyStatisticItem -> Bool
> :: AnyStatisticItem -> AnyStatisticItem -> Bool
$c> :: AnyStatisticItem -> AnyStatisticItem -> Bool
<= :: AnyStatisticItem -> AnyStatisticItem -> Bool
$c<= :: AnyStatisticItem -> AnyStatisticItem -> Bool
< :: AnyStatisticItem -> AnyStatisticItem -> Bool
$c< :: AnyStatisticItem -> AnyStatisticItem -> Bool
compare :: AnyStatisticItem -> AnyStatisticItem -> Ordering
$ccompare :: AnyStatisticItem -> AnyStatisticItem -> Ordering
$cp1Ord :: Eq AnyStatisticItem
Ord, Int -> AnyStatisticItem -> ShowS
[AnyStatisticItem] -> ShowS
AnyStatisticItem -> String
(Int -> AnyStatisticItem -> ShowS)
-> (AnyStatisticItem -> String)
-> ([AnyStatisticItem] -> ShowS)
-> Show AnyStatisticItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnyStatisticItem] -> ShowS
$cshowList :: [AnyStatisticItem] -> ShowS
show :: AnyStatisticItem -> String
$cshow :: AnyStatisticItem -> String
showsPrec :: Int -> AnyStatisticItem -> ShowS
$cshowsPrec :: Int -> AnyStatisticItem -> ShowS
Show, (forall x. AnyStatisticItem -> Rep AnyStatisticItem x)
-> (forall x. Rep AnyStatisticItem x -> AnyStatisticItem)
-> Generic AnyStatisticItem
forall x. Rep AnyStatisticItem x -> AnyStatisticItem
forall x. AnyStatisticItem -> Rep AnyStatisticItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnyStatisticItem x -> AnyStatisticItem
$cfrom :: forall x. AnyStatisticItem -> Rep AnyStatisticItem x
Generic, AnyStatisticItem -> ()
(AnyStatisticItem -> ()) -> NFData AnyStatisticItem
forall a. (a -> ()) -> NFData a
rnf :: AnyStatisticItem -> ()
$crnf :: AnyStatisticItem -> ()
NFData, Typeable AnyStatisticItem
DataType
Constr
Typeable AnyStatisticItem =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> AnyStatisticItem -> c AnyStatisticItem)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c AnyStatisticItem)
-> (AnyStatisticItem -> Constr)
-> (AnyStatisticItem -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c AnyStatisticItem))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c AnyStatisticItem))
-> ((forall b. Data b => b -> b)
    -> AnyStatisticItem -> AnyStatisticItem)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> AnyStatisticItem -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> AnyStatisticItem -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> AnyStatisticItem -> m AnyStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> AnyStatisticItem -> m AnyStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> AnyStatisticItem -> m AnyStatisticItem)
-> Data AnyStatisticItem
AnyStatisticItem -> DataType
AnyStatisticItem -> Constr
(forall b. Data b => b -> b)
-> AnyStatisticItem -> AnyStatisticItem
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnyStatisticItem -> c AnyStatisticItem
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnyStatisticItem
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> AnyStatisticItem -> u
forall u. (forall d. Data d => d -> u) -> AnyStatisticItem -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnyStatisticItem
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnyStatisticItem -> c AnyStatisticItem
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnyStatisticItem)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c AnyStatisticItem)
$cAnyRingStatisticItem :: Constr
$cAnyMapStatisticItem :: Constr
$cAnyStatisticItem :: Constr
$tAnyStatisticItem :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
gmapMp :: (forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
gmapM :: (forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> AnyStatisticItem -> m AnyStatisticItem
gmapQi :: Int -> (forall d. Data d => d -> u) -> AnyStatisticItem -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> AnyStatisticItem -> u
gmapQ :: (forall d. Data d => d -> u) -> AnyStatisticItem -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> AnyStatisticItem -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnyStatisticItem -> r
gmapT :: (forall b. Data b => b -> b)
-> AnyStatisticItem -> AnyStatisticItem
$cgmapT :: (forall b. Data b => b -> b)
-> AnyStatisticItem -> AnyStatisticItem
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c AnyStatisticItem)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c AnyStatisticItem)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c AnyStatisticItem)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnyStatisticItem)
dataTypeOf :: AnyStatisticItem -> DataType
$cdataTypeOf :: AnyStatisticItem -> DataType
toConstr :: AnyStatisticItem -> Constr
$ctoConstr :: AnyStatisticItem -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnyStatisticItem
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnyStatisticItem
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnyStatisticItem -> c AnyStatisticItem
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnyStatisticItem -> c AnyStatisticItem
$cp1Data :: Typeable AnyStatisticItem
Data)

instance ToJSON AnyStatisticItem where
  toJSON :: AnyStatisticItem -> Value
toJSON (AnyStatisticItem si :: StatisticItem
si) = [Pair] -> Value
object [ "type" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Text -> Value
String "StatisticItem"
                                        , "name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= StatisticItem -> Text
si_name StatisticItem
si
                                        , "value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= StatisticItem -> Text
si_value StatisticItem
si ]
  toJSON (AnyMapStatisticItem si :: MapStatisticItem
si) = [Pair] -> Value
object [ "type" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Text -> Value
String "MapStatisticItem"
                                           , "name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= MapStatisticItem -> Text
msi_name MapStatisticItem
si
                                           , "value" Text -> [SimpleStatisticItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= MapStatisticItem -> [SimpleStatisticItem]
msi_value MapStatisticItem
si ]
  toJSON (AnyRingStatisticItem si :: RingStatisticItem
si) = [Pair] -> Value
object [ "type" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Text -> Value
String "RingStatisticItem"
                                            , "name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= RingStatisticItem -> Text
rsi_name RingStatisticItem
si
                                            , "size" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Text -> Value
String (Integer -> Text
forall a. Show a => a -> Text
showT (RingStatisticItem -> Integer
rsi_size RingStatisticItem
si))
                                            , "value" Text -> [SimpleStatisticItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= RingStatisticItem -> [SimpleStatisticItem]
rsi_value RingStatisticItem
si ]

showT :: Show a => a -> T.Text
showT :: a -> Text
showT = String -> Text
T.pack (String -> Text) -> (a -> String) -> a -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show

thruRead :: Read a => T.Text -> Parser a
thruRead :: Text -> Parser a
thruRead = Parser a -> (a -> Parser a) -> Maybe a -> Parser a
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail "failed to parse") a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe a -> Parser a) -> (Text -> Maybe a) -> Text -> Parser a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe a
forall a. Read a => String -> Maybe a
readMaybe (String -> Maybe a) -> (Text -> String) -> Text -> Maybe a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> String
T.unpack

instance FromJSON AnyStatisticItem where
  parseJSON :: Value -> Parser AnyStatisticItem
parseJSON = String
-> (Object -> Parser AnyStatisticItem)
-> Value
-> Parser AnyStatisticItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject "Any StatisticItem" ((Object -> Parser AnyStatisticItem)
 -> Value -> Parser AnyStatisticItem)
-> (Object -> Parser AnyStatisticItem)
-> Value
-> Parser AnyStatisticItem
forall a b. (a -> b) -> a -> b
$ \o :: Object
o -> do
    Text
r <- Object
o Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
.: "type"
    case Text
r of
      "StatisticItem" -> (StatisticItem -> AnyStatisticItem)
-> Parser StatisticItem -> Parser AnyStatisticItem
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap StatisticItem -> AnyStatisticItem
AnyStatisticItem (Parser StatisticItem -> Parser AnyStatisticItem)
-> Parser StatisticItem -> Parser AnyStatisticItem
forall a b. (a -> b) -> a -> b
$
                         Text -> Text -> StatisticItem
StatisticItem (Text -> Text -> StatisticItem)
-> Parser Text -> Parser (Text -> StatisticItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
.: "name"
                                       Parser (Text -> StatisticItem)
-> Parser Text -> Parser StatisticItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
.: "value"
      "MapStatisticItem" -> (MapStatisticItem -> AnyStatisticItem)
-> Parser MapStatisticItem -> Parser AnyStatisticItem
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap MapStatisticItem -> AnyStatisticItem
AnyMapStatisticItem (Parser MapStatisticItem -> Parser AnyStatisticItem)
-> Parser MapStatisticItem -> Parser AnyStatisticItem
forall a b. (a -> b) -> a -> b
$
                            Text -> [SimpleStatisticItem] -> MapStatisticItem
MapStatisticItem (Text -> [SimpleStatisticItem] -> MapStatisticItem)
-> Parser Text
-> Parser ([SimpleStatisticItem] -> MapStatisticItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
.: "name"
                                             Parser ([SimpleStatisticItem] -> MapStatisticItem)
-> Parser [SimpleStatisticItem] -> Parser MapStatisticItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Text -> Parser [SimpleStatisticItem]
forall a. FromJSON a => Object -> Text -> Parser a
.: "value"
      "RingStatisticItem" -> (RingStatisticItem -> AnyStatisticItem)
-> Parser RingStatisticItem -> Parser AnyStatisticItem
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap RingStatisticItem -> AnyStatisticItem
AnyRingStatisticItem (Parser RingStatisticItem -> Parser AnyStatisticItem)
-> Parser RingStatisticItem -> Parser AnyStatisticItem
forall a b. (a -> b) -> a -> b
$
                             Text -> Integer -> [SimpleStatisticItem] -> RingStatisticItem
RingStatisticItem (Text -> Integer -> [SimpleStatisticItem] -> RingStatisticItem)
-> Parser Text
-> Parser (Integer -> [SimpleStatisticItem] -> RingStatisticItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
.: "name"
                                               Parser (Integer -> [SimpleStatisticItem] -> RingStatisticItem)
-> Parser Integer
-> Parser ([SimpleStatisticItem] -> RingStatisticItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
.: "size" Parser Text -> (Text -> Parser Integer) -> Parser Integer
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Text -> Parser Integer
forall a. Read a => Text -> Parser a
thruRead)
                                               Parser ([SimpleStatisticItem] -> RingStatisticItem)
-> Parser [SimpleStatisticItem] -> Parser RingStatisticItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Text -> Parser [SimpleStatisticItem]
forall a. FromJSON a => Object -> Text -> Parser a
.: "value"
      _ -> String -> Parser AnyStatisticItem
forall (m :: * -> *) a. MonadFail m => String -> m a
fail ("Unknown type: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
T.unpack Text
r)

data StatisticItem = StatisticItem
  { StatisticItem -> Text
si_name :: T.Text
  , StatisticItem -> Text
si_value :: T.Text
  } deriving (StatisticItem -> StatisticItem -> Bool
(StatisticItem -> StatisticItem -> Bool)
-> (StatisticItem -> StatisticItem -> Bool) -> Eq StatisticItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatisticItem -> StatisticItem -> Bool
$c/= :: StatisticItem -> StatisticItem -> Bool
== :: StatisticItem -> StatisticItem -> Bool
$c== :: StatisticItem -> StatisticItem -> Bool
Eq, Eq StatisticItem
Eq StatisticItem =>
(StatisticItem -> StatisticItem -> Ordering)
-> (StatisticItem -> StatisticItem -> Bool)
-> (StatisticItem -> StatisticItem -> Bool)
-> (StatisticItem -> StatisticItem -> Bool)
-> (StatisticItem -> StatisticItem -> Bool)
-> (StatisticItem -> StatisticItem -> StatisticItem)
-> (StatisticItem -> StatisticItem -> StatisticItem)
-> Ord StatisticItem
StatisticItem -> StatisticItem -> Bool
StatisticItem -> StatisticItem -> Ordering
StatisticItem -> StatisticItem -> StatisticItem
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: StatisticItem -> StatisticItem -> StatisticItem
$cmin :: StatisticItem -> StatisticItem -> StatisticItem
max :: StatisticItem -> StatisticItem -> StatisticItem
$cmax :: StatisticItem -> StatisticItem -> StatisticItem
>= :: StatisticItem -> StatisticItem -> Bool
$c>= :: StatisticItem -> StatisticItem -> Bool
> :: StatisticItem -> StatisticItem -> Bool
$c> :: StatisticItem -> StatisticItem -> Bool
<= :: StatisticItem -> StatisticItem -> Bool
$c<= :: StatisticItem -> StatisticItem -> Bool
< :: StatisticItem -> StatisticItem -> Bool
$c< :: StatisticItem -> StatisticItem -> Bool
compare :: StatisticItem -> StatisticItem -> Ordering
$ccompare :: StatisticItem -> StatisticItem -> Ordering
$cp1Ord :: Eq StatisticItem
Ord, Int -> StatisticItem -> ShowS
[StatisticItem] -> ShowS
StatisticItem -> String
(Int -> StatisticItem -> ShowS)
-> (StatisticItem -> String)
-> ([StatisticItem] -> ShowS)
-> Show StatisticItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatisticItem] -> ShowS
$cshowList :: [StatisticItem] -> ShowS
show :: StatisticItem -> String
$cshow :: StatisticItem -> String
showsPrec :: Int -> StatisticItem -> ShowS
$cshowsPrec :: Int -> StatisticItem -> ShowS
Show, (forall x. StatisticItem -> Rep StatisticItem x)
-> (forall x. Rep StatisticItem x -> StatisticItem)
-> Generic StatisticItem
forall x. Rep StatisticItem x -> StatisticItem
forall x. StatisticItem -> Rep StatisticItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatisticItem x -> StatisticItem
$cfrom :: forall x. StatisticItem -> Rep StatisticItem x
Generic, StatisticItem -> ()
(StatisticItem -> ()) -> NFData StatisticItem
forall a. (a -> ()) -> NFData a
rnf :: StatisticItem -> ()
$crnf :: StatisticItem -> ()
NFData, Typeable StatisticItem
DataType
Constr
Typeable StatisticItem =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> StatisticItem -> c StatisticItem)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c StatisticItem)
-> (StatisticItem -> Constr)
-> (StatisticItem -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c StatisticItem))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c StatisticItem))
-> ((forall b. Data b => b -> b) -> StatisticItem -> StatisticItem)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> StatisticItem -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> StatisticItem -> r)
-> (forall u. (forall d. Data d => d -> u) -> StatisticItem -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> StatisticItem -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem)
-> Data StatisticItem
StatisticItem -> DataType
StatisticItem -> Constr
(forall b. Data b => b -> b) -> StatisticItem -> StatisticItem
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatisticItem -> c StatisticItem
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatisticItem
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> StatisticItem -> u
forall u. (forall d. Data d => d -> u) -> StatisticItem -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatisticItem -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> StatisticItem -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatisticItem
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatisticItem -> c StatisticItem
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c StatisticItem)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatisticItem)
$cStatisticItem :: Constr
$tStatisticItem :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
gmapMp :: (forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
gmapM :: (forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> StatisticItem -> m StatisticItem
gmapQi :: Int -> (forall d. Data d => d -> u) -> StatisticItem -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> StatisticItem -> u
gmapQ :: (forall d. Data d => d -> u) -> StatisticItem -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> StatisticItem -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> StatisticItem -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> StatisticItem -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatisticItem -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> StatisticItem -> r
gmapT :: (forall b. Data b => b -> b) -> StatisticItem -> StatisticItem
$cgmapT :: (forall b. Data b => b -> b) -> StatisticItem -> StatisticItem
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatisticItem)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c StatisticItem)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c StatisticItem)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c StatisticItem)
dataTypeOf :: StatisticItem -> DataType
$cdataTypeOf :: StatisticItem -> DataType
toConstr :: StatisticItem -> Constr
$ctoConstr :: StatisticItem -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatisticItem
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c StatisticItem
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatisticItem -> c StatisticItem
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> StatisticItem -> c StatisticItem
$cp1Data :: Typeable StatisticItem
Data)

data MapStatisticItem = MapStatisticItem
  { MapStatisticItem -> Text
msi_name :: T.Text
  , MapStatisticItem -> [SimpleStatisticItem]
msi_value :: [SimpleStatisticItem]
  } deriving (MapStatisticItem -> MapStatisticItem -> Bool
(MapStatisticItem -> MapStatisticItem -> Bool)
-> (MapStatisticItem -> MapStatisticItem -> Bool)
-> Eq MapStatisticItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MapStatisticItem -> MapStatisticItem -> Bool
$c/= :: MapStatisticItem -> MapStatisticItem -> Bool
== :: MapStatisticItem -> MapStatisticItem -> Bool
$c== :: MapStatisticItem -> MapStatisticItem -> Bool
Eq, Eq MapStatisticItem
Eq MapStatisticItem =>
(MapStatisticItem -> MapStatisticItem -> Ordering)
-> (MapStatisticItem -> MapStatisticItem -> Bool)
-> (MapStatisticItem -> MapStatisticItem -> Bool)
-> (MapStatisticItem -> MapStatisticItem -> Bool)
-> (MapStatisticItem -> MapStatisticItem -> Bool)
-> (MapStatisticItem -> MapStatisticItem -> MapStatisticItem)
-> (MapStatisticItem -> MapStatisticItem -> MapStatisticItem)
-> Ord MapStatisticItem
MapStatisticItem -> MapStatisticItem -> Bool
MapStatisticItem -> MapStatisticItem -> Ordering
MapStatisticItem -> MapStatisticItem -> MapStatisticItem
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: MapStatisticItem -> MapStatisticItem -> MapStatisticItem
$cmin :: MapStatisticItem -> MapStatisticItem -> MapStatisticItem
max :: MapStatisticItem -> MapStatisticItem -> MapStatisticItem
$cmax :: MapStatisticItem -> MapStatisticItem -> MapStatisticItem
>= :: MapStatisticItem -> MapStatisticItem -> Bool
$c>= :: MapStatisticItem -> MapStatisticItem -> Bool
> :: MapStatisticItem -> MapStatisticItem -> Bool
$c> :: MapStatisticItem -> MapStatisticItem -> Bool
<= :: MapStatisticItem -> MapStatisticItem -> Bool
$c<= :: MapStatisticItem -> MapStatisticItem -> Bool
< :: MapStatisticItem -> MapStatisticItem -> Bool
$c< :: MapStatisticItem -> MapStatisticItem -> Bool
compare :: MapStatisticItem -> MapStatisticItem -> Ordering
$ccompare :: MapStatisticItem -> MapStatisticItem -> Ordering
$cp1Ord :: Eq MapStatisticItem
Ord, Int -> MapStatisticItem -> ShowS
[MapStatisticItem] -> ShowS
MapStatisticItem -> String
(Int -> MapStatisticItem -> ShowS)
-> (MapStatisticItem -> String)
-> ([MapStatisticItem] -> ShowS)
-> Show MapStatisticItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MapStatisticItem] -> ShowS
$cshowList :: [MapStatisticItem] -> ShowS
show :: MapStatisticItem -> String
$cshow :: MapStatisticItem -> String
showsPrec :: Int -> MapStatisticItem -> ShowS
$cshowsPrec :: Int -> MapStatisticItem -> ShowS
Show, (forall x. MapStatisticItem -> Rep MapStatisticItem x)
-> (forall x. Rep MapStatisticItem x -> MapStatisticItem)
-> Generic MapStatisticItem
forall x. Rep MapStatisticItem x -> MapStatisticItem
forall x. MapStatisticItem -> Rep MapStatisticItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MapStatisticItem x -> MapStatisticItem
$cfrom :: forall x. MapStatisticItem -> Rep MapStatisticItem x
Generic, MapStatisticItem -> ()
(MapStatisticItem -> ()) -> NFData MapStatisticItem
forall a. (a -> ()) -> NFData a
rnf :: MapStatisticItem -> ()
$crnf :: MapStatisticItem -> ()
NFData, Typeable MapStatisticItem
DataType
Constr
Typeable MapStatisticItem =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> MapStatisticItem -> c MapStatisticItem)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MapStatisticItem)
-> (MapStatisticItem -> Constr)
-> (MapStatisticItem -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MapStatisticItem))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MapStatisticItem))
-> ((forall b. Data b => b -> b)
    -> MapStatisticItem -> MapStatisticItem)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> MapStatisticItem -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> MapStatisticItem -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> MapStatisticItem -> m MapStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MapStatisticItem -> m MapStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MapStatisticItem -> m MapStatisticItem)
-> Data MapStatisticItem
MapStatisticItem -> DataType
MapStatisticItem -> Constr
(forall b. Data b => b -> b)
-> MapStatisticItem -> MapStatisticItem
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MapStatisticItem -> c MapStatisticItem
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MapStatisticItem
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> MapStatisticItem -> u
forall u. (forall d. Data d => d -> u) -> MapStatisticItem -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MapStatisticItem
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MapStatisticItem -> c MapStatisticItem
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MapStatisticItem)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MapStatisticItem)
$cMapStatisticItem :: Constr
$tMapStatisticItem :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
gmapMp :: (forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
gmapM :: (forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MapStatisticItem -> m MapStatisticItem
gmapQi :: Int -> (forall d. Data d => d -> u) -> MapStatisticItem -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> MapStatisticItem -> u
gmapQ :: (forall d. Data d => d -> u) -> MapStatisticItem -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MapStatisticItem -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MapStatisticItem -> r
gmapT :: (forall b. Data b => b -> b)
-> MapStatisticItem -> MapStatisticItem
$cgmapT :: (forall b. Data b => b -> b)
-> MapStatisticItem -> MapStatisticItem
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MapStatisticItem)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MapStatisticItem)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MapStatisticItem)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MapStatisticItem)
dataTypeOf :: MapStatisticItem -> DataType
$cdataTypeOf :: MapStatisticItem -> DataType
toConstr :: MapStatisticItem -> Constr
$ctoConstr :: MapStatisticItem -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MapStatisticItem
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MapStatisticItem
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MapStatisticItem -> c MapStatisticItem
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MapStatisticItem -> c MapStatisticItem
$cp1Data :: Typeable MapStatisticItem
Data)

data RingStatisticItem = RingStatisticItem
  { RingStatisticItem -> Text
rsi_name :: T.Text
  , RingStatisticItem -> Integer
rsi_size :: Integer
  , RingStatisticItem -> [SimpleStatisticItem]
rsi_value :: [SimpleStatisticItem]
  } deriving (RingStatisticItem -> RingStatisticItem -> Bool
(RingStatisticItem -> RingStatisticItem -> Bool)
-> (RingStatisticItem -> RingStatisticItem -> Bool)
-> Eq RingStatisticItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RingStatisticItem -> RingStatisticItem -> Bool
$c/= :: RingStatisticItem -> RingStatisticItem -> Bool
== :: RingStatisticItem -> RingStatisticItem -> Bool
$c== :: RingStatisticItem -> RingStatisticItem -> Bool
Eq, Eq RingStatisticItem
Eq RingStatisticItem =>
(RingStatisticItem -> RingStatisticItem -> Ordering)
-> (RingStatisticItem -> RingStatisticItem -> Bool)
-> (RingStatisticItem -> RingStatisticItem -> Bool)
-> (RingStatisticItem -> RingStatisticItem -> Bool)
-> (RingStatisticItem -> RingStatisticItem -> Bool)
-> (RingStatisticItem -> RingStatisticItem -> RingStatisticItem)
-> (RingStatisticItem -> RingStatisticItem -> RingStatisticItem)
-> Ord RingStatisticItem
RingStatisticItem -> RingStatisticItem -> Bool
RingStatisticItem -> RingStatisticItem -> Ordering
RingStatisticItem -> RingStatisticItem -> RingStatisticItem
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: RingStatisticItem -> RingStatisticItem -> RingStatisticItem
$cmin :: RingStatisticItem -> RingStatisticItem -> RingStatisticItem
max :: RingStatisticItem -> RingStatisticItem -> RingStatisticItem
$cmax :: RingStatisticItem -> RingStatisticItem -> RingStatisticItem
>= :: RingStatisticItem -> RingStatisticItem -> Bool
$c>= :: RingStatisticItem -> RingStatisticItem -> Bool
> :: RingStatisticItem -> RingStatisticItem -> Bool
$c> :: RingStatisticItem -> RingStatisticItem -> Bool
<= :: RingStatisticItem -> RingStatisticItem -> Bool
$c<= :: RingStatisticItem -> RingStatisticItem -> Bool
< :: RingStatisticItem -> RingStatisticItem -> Bool
$c< :: RingStatisticItem -> RingStatisticItem -> Bool
compare :: RingStatisticItem -> RingStatisticItem -> Ordering
$ccompare :: RingStatisticItem -> RingStatisticItem -> Ordering
$cp1Ord :: Eq RingStatisticItem
Ord, Int -> RingStatisticItem -> ShowS
[RingStatisticItem] -> ShowS
RingStatisticItem -> String
(Int -> RingStatisticItem -> ShowS)
-> (RingStatisticItem -> String)
-> ([RingStatisticItem] -> ShowS)
-> Show RingStatisticItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RingStatisticItem] -> ShowS
$cshowList :: [RingStatisticItem] -> ShowS
show :: RingStatisticItem -> String
$cshow :: RingStatisticItem -> String
showsPrec :: Int -> RingStatisticItem -> ShowS
$cshowsPrec :: Int -> RingStatisticItem -> ShowS
Show, (forall x. RingStatisticItem -> Rep RingStatisticItem x)
-> (forall x. Rep RingStatisticItem x -> RingStatisticItem)
-> Generic RingStatisticItem
forall x. Rep RingStatisticItem x -> RingStatisticItem
forall x. RingStatisticItem -> Rep RingStatisticItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RingStatisticItem x -> RingStatisticItem
$cfrom :: forall x. RingStatisticItem -> Rep RingStatisticItem x
Generic, RingStatisticItem -> ()
(RingStatisticItem -> ()) -> NFData RingStatisticItem
forall a. (a -> ()) -> NFData a
rnf :: RingStatisticItem -> ()
$crnf :: RingStatisticItem -> ()
NFData, Typeable RingStatisticItem
DataType
Constr
Typeable RingStatisticItem =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> RingStatisticItem
 -> c RingStatisticItem)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RingStatisticItem)
-> (RingStatisticItem -> Constr)
-> (RingStatisticItem -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RingStatisticItem))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RingStatisticItem))
-> ((forall b. Data b => b -> b)
    -> RingStatisticItem -> RingStatisticItem)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> RingStatisticItem -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> RingStatisticItem -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> RingStatisticItem -> m RingStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RingStatisticItem -> m RingStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RingStatisticItem -> m RingStatisticItem)
-> Data RingStatisticItem
RingStatisticItem -> DataType
RingStatisticItem -> Constr
(forall b. Data b => b -> b)
-> RingStatisticItem -> RingStatisticItem
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RingStatisticItem -> c RingStatisticItem
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RingStatisticItem
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> RingStatisticItem -> u
forall u. (forall d. Data d => d -> u) -> RingStatisticItem -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RingStatisticItem
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RingStatisticItem -> c RingStatisticItem
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RingStatisticItem)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RingStatisticItem)
$cRingStatisticItem :: Constr
$tRingStatisticItem :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
gmapMp :: (forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
gmapM :: (forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RingStatisticItem -> m RingStatisticItem
gmapQi :: Int -> (forall d. Data d => d -> u) -> RingStatisticItem -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> RingStatisticItem -> u
gmapQ :: (forall d. Data d => d -> u) -> RingStatisticItem -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RingStatisticItem -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RingStatisticItem -> r
gmapT :: (forall b. Data b => b -> b)
-> RingStatisticItem -> RingStatisticItem
$cgmapT :: (forall b. Data b => b -> b)
-> RingStatisticItem -> RingStatisticItem
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RingStatisticItem)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RingStatisticItem)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c RingStatisticItem)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RingStatisticItem)
dataTypeOf :: RingStatisticItem -> DataType
$cdataTypeOf :: RingStatisticItem -> DataType
toConstr :: RingStatisticItem -> Constr
$ctoConstr :: RingStatisticItem -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RingStatisticItem
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RingStatisticItem
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RingStatisticItem -> c RingStatisticItem
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RingStatisticItem -> c RingStatisticItem
$cp1Data :: Typeable RingStatisticItem
Data)

data SimpleStatisticItem = SimpleStatisticItem
  { SimpleStatisticItem -> Text
ssi_name :: T.Text
  , SimpleStatisticItem -> Text
ssi_value :: T.Text
  } deriving (SimpleStatisticItem -> SimpleStatisticItem -> Bool
(SimpleStatisticItem -> SimpleStatisticItem -> Bool)
-> (SimpleStatisticItem -> SimpleStatisticItem -> Bool)
-> Eq SimpleStatisticItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
$c/= :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
== :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
$c== :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
Eq, Eq SimpleStatisticItem
Eq SimpleStatisticItem =>
(SimpleStatisticItem -> SimpleStatisticItem -> Ordering)
-> (SimpleStatisticItem -> SimpleStatisticItem -> Bool)
-> (SimpleStatisticItem -> SimpleStatisticItem -> Bool)
-> (SimpleStatisticItem -> SimpleStatisticItem -> Bool)
-> (SimpleStatisticItem -> SimpleStatisticItem -> Bool)
-> (SimpleStatisticItem
    -> SimpleStatisticItem -> SimpleStatisticItem)
-> (SimpleStatisticItem
    -> SimpleStatisticItem -> SimpleStatisticItem)
-> Ord SimpleStatisticItem
SimpleStatisticItem -> SimpleStatisticItem -> Bool
SimpleStatisticItem -> SimpleStatisticItem -> Ordering
SimpleStatisticItem -> SimpleStatisticItem -> SimpleStatisticItem
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SimpleStatisticItem -> SimpleStatisticItem -> SimpleStatisticItem
$cmin :: SimpleStatisticItem -> SimpleStatisticItem -> SimpleStatisticItem
max :: SimpleStatisticItem -> SimpleStatisticItem -> SimpleStatisticItem
$cmax :: SimpleStatisticItem -> SimpleStatisticItem -> SimpleStatisticItem
>= :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
$c>= :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
> :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
$c> :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
<= :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
$c<= :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
< :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
$c< :: SimpleStatisticItem -> SimpleStatisticItem -> Bool
compare :: SimpleStatisticItem -> SimpleStatisticItem -> Ordering
$ccompare :: SimpleStatisticItem -> SimpleStatisticItem -> Ordering
$cp1Ord :: Eq SimpleStatisticItem
Ord, Int -> SimpleStatisticItem -> ShowS
[SimpleStatisticItem] -> ShowS
SimpleStatisticItem -> String
(Int -> SimpleStatisticItem -> ShowS)
-> (SimpleStatisticItem -> String)
-> ([SimpleStatisticItem] -> ShowS)
-> Show SimpleStatisticItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SimpleStatisticItem] -> ShowS
$cshowList :: [SimpleStatisticItem] -> ShowS
show :: SimpleStatisticItem -> String
$cshow :: SimpleStatisticItem -> String
showsPrec :: Int -> SimpleStatisticItem -> ShowS
$cshowsPrec :: Int -> SimpleStatisticItem -> ShowS
Show, (forall x. SimpleStatisticItem -> Rep SimpleStatisticItem x)
-> (forall x. Rep SimpleStatisticItem x -> SimpleStatisticItem)
-> Generic SimpleStatisticItem
forall x. Rep SimpleStatisticItem x -> SimpleStatisticItem
forall x. SimpleStatisticItem -> Rep SimpleStatisticItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SimpleStatisticItem x -> SimpleStatisticItem
$cfrom :: forall x. SimpleStatisticItem -> Rep SimpleStatisticItem x
Generic, SimpleStatisticItem -> ()
(SimpleStatisticItem -> ()) -> NFData SimpleStatisticItem
forall a. (a -> ()) -> NFData a
rnf :: SimpleStatisticItem -> ()
$crnf :: SimpleStatisticItem -> ()
NFData, Typeable SimpleStatisticItem
DataType
Constr
Typeable SimpleStatisticItem =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> SimpleStatisticItem
 -> c SimpleStatisticItem)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SimpleStatisticItem)
-> (SimpleStatisticItem -> Constr)
-> (SimpleStatisticItem -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SimpleStatisticItem))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SimpleStatisticItem))
-> ((forall b. Data b => b -> b)
    -> SimpleStatisticItem -> SimpleStatisticItem)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SimpleStatisticItem -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SimpleStatisticItem -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SimpleStatisticItem -> m SimpleStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SimpleStatisticItem -> m SimpleStatisticItem)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SimpleStatisticItem -> m SimpleStatisticItem)
-> Data SimpleStatisticItem
SimpleStatisticItem -> DataType
SimpleStatisticItem -> Constr
(forall b. Data b => b -> b)
-> SimpleStatisticItem -> SimpleStatisticItem
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SimpleStatisticItem
-> c SimpleStatisticItem
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SimpleStatisticItem
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> SimpleStatisticItem -> u
forall u.
(forall d. Data d => d -> u) -> SimpleStatisticItem -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SimpleStatisticItem
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SimpleStatisticItem
-> c SimpleStatisticItem
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SimpleStatisticItem)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SimpleStatisticItem)
$cSimpleStatisticItem :: Constr
$tSimpleStatisticItem :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
gmapMp :: (forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
gmapM :: (forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SimpleStatisticItem -> m SimpleStatisticItem
gmapQi :: Int -> (forall d. Data d => d -> u) -> SimpleStatisticItem -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SimpleStatisticItem -> u
gmapQ :: (forall d. Data d => d -> u) -> SimpleStatisticItem -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> SimpleStatisticItem -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SimpleStatisticItem -> r
gmapT :: (forall b. Data b => b -> b)
-> SimpleStatisticItem -> SimpleStatisticItem
$cgmapT :: (forall b. Data b => b -> b)
-> SimpleStatisticItem -> SimpleStatisticItem
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SimpleStatisticItem)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SimpleStatisticItem)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SimpleStatisticItem)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SimpleStatisticItem)
dataTypeOf :: SimpleStatisticItem -> DataType
$cdataTypeOf :: SimpleStatisticItem -> DataType
toConstr :: SimpleStatisticItem -> Constr
$ctoConstr :: SimpleStatisticItem -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SimpleStatisticItem
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SimpleStatisticItem
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SimpleStatisticItem
-> c SimpleStatisticItem
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SimpleStatisticItem
-> c SimpleStatisticItem
$cp1Data :: Typeable SimpleStatisticItem
Data)

instance ToJSON SimpleStatisticItem where
  toJSON :: SimpleStatisticItem -> Value
toJSON = Options -> SimpleStatisticItem -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "ssi_"}

instance FromJSON SimpleStatisticItem where
  parseJSON :: Value -> Parser SimpleStatisticItem
parseJSON = Options -> Value -> Parser SimpleStatisticItem
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
defaultOptions { fieldLabelModifier :: ShowS
fieldLabelModifier = String -> ShowS
forall a. Eq a => [a] -> [a] -> [a]
strip "ssi_"}