{-# LANGUAGE DataKinds #-}

module Unison.Server.HistoryComments.API (api, API, Routes (..)) where

import Data.Proxy
import GHC.Generics (Generic)
import Servant.API
import Servant.API.WebSocket
import Unison.Server.Types (BranchRef, RequiredQueryParam)

api :: Proxy API
api :: Proxy API
api = Proxy API
forall {k} (t :: k). Proxy t
Proxy

type API = NamedRoutes Routes

type DownloadCommentsStream =
  RequiredQueryParam "branchRef" BranchRef
    :> WebSocket

type UploadCommentsStream =
  RequiredQueryParam "branchRef" BranchRef
    :> WebSocket

data Routes mode = Routes
  { forall mode.
Routes mode -> mode :- ("upload" :> UploadCommentsStream)
uploadHistoryComments :: mode :- "upload" :> UploadCommentsStream,
    forall mode.
Routes mode -> mode :- ("download" :> UploadCommentsStream)
downloadHistoryComments :: mode :- "download" :> DownloadCommentsStream
  }
  deriving stock ((forall x. Routes mode -> Rep (Routes mode) x)
-> (forall x. Rep (Routes mode) x -> Routes mode)
-> Generic (Routes mode)
forall x. Rep (Routes mode) x -> Routes mode
forall x. Routes mode -> Rep (Routes mode) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall mode x. Rep (Routes mode) x -> Routes mode
forall mode x. Routes mode -> Rep (Routes mode) x
$cfrom :: forall mode x. Routes mode -> Rep (Routes mode) x
from :: forall x. Routes mode -> Rep (Routes mode) x
$cto :: forall mode x. Rep (Routes mode) x -> Routes mode
to :: forall x. Rep (Routes mode) x -> Routes mode
Generic)