{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
module IOHK.Cicero.API where

import Servant.API
import Servant.API.NamedRoutes
import Servant.API.Generic

import IOHK.Cicero.API.Action as Action
import IOHK.Cicero.API.Fact as Fact
import IOHK.Cicero.API.Invocation as Invocation
import IOHK.Cicero.API.Run as Run

-- | The Cicero API
type API = "api" :> NamedRoutes APIRoutes

-- | The routes for the Cicero API
data APIRoutes mode = APIRoutes
  { forall mode. APIRoutes mode -> mode :- ("action" :> API)
action :: mode :- "action" :> Action.API
  , forall mode. APIRoutes mode -> mode :- ("fact" :> API)
fact :: mode :- "fact" :> Fact.API
  , forall mode. APIRoutes mode -> mode :- ("invocation" :> API)
invocation :: mode :- "invocation" :> Invocation.API
  , forall mode. APIRoutes mode -> mode :- ("run" :> API)
run :: mode :- "run" :> Run.API
  } deriving stock forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall mode x. Rep (APIRoutes mode) x -> APIRoutes mode
forall mode x. APIRoutes mode -> Rep (APIRoutes mode) x
$cto :: forall mode x. Rep (APIRoutes mode) x -> APIRoutes mode
$cfrom :: forall mode x. APIRoutes mode -> Rep (APIRoutes mode) x
Generic