{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}

module Hercules.API.Logs
  ( LogsAPI (..),
  )
where

import Data.ByteString (ByteString)
import Hercules.API.Prelude
import Servant.API
import Servant.API.Generic
import Servant.Auth

data LogsAPI logJWT f = LogsAPI
  { forall logJWT f.
LogsAPI logJWT f
-> f
   :- (Summary "Write to a log"
       :> (Description
             "Writes an entire log in a single request. Provide a log-specific token for authentication."
           :> ("log"
               :> (Auth '[JWT] logJWT
                   :> (ReqBody '[OctetStream] ByteString
                       :> Post '[JSON] NoContent)))))
writeLog ::
      f
        :- Summary "Write to a log"
        :> Description "Writes an entire log in a single request. Provide a log-specific token for authentication."
        :> "log"
        :> Auth '[JWT] logJWT
        :> ReqBody '[OctetStream] ByteString
        :> Post '[JSON] NoContent
  }
  deriving ((forall x. LogsAPI logJWT f -> Rep (LogsAPI logJWT f) x)
-> (forall x. Rep (LogsAPI logJWT f) x -> LogsAPI logJWT f)
-> Generic (LogsAPI logJWT f)
forall x. Rep (LogsAPI logJWT f) x -> LogsAPI logJWT f
forall x. LogsAPI logJWT f -> Rep (LogsAPI logJWT f) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall logJWT f x. Rep (LogsAPI logJWT f) x -> LogsAPI logJWT f
forall logJWT f x. LogsAPI logJWT f -> Rep (LogsAPI logJWT f) x
$cto :: forall logJWT f x. Rep (LogsAPI logJWT f) x -> LogsAPI logJWT f
$cfrom :: forall logJWT f x. LogsAPI logJWT f -> Rep (LogsAPI logJWT f) x
Generic)