{-# LANGUAGE DataKinds #-}

module Hercules.API.GitLab where

import Hercules.API.Accounts.Account (Account)
import Hercules.API.GitLab.CreateInstallationBuilderRequest (CreateInstallationBuilderRequest)
import Hercules.API.GitLab.InstallationBuilder (InstallationBuilder, InstallationBuilders)
import Hercules.API.GitLab.PatchInstallationBuilder (PatchInstallationBuilder)
import Hercules.API.Prelude
import Servant.API

data GitLabAPI auth f = GitLabAPI
  { forall auth f.
GitLabAPI auth f
-> f
   :- ("gitlab"
       :> ("installation"
           :> (ReqBody '[JSON] CreateInstallationBuilderRequest
               :> (auth :> Post '[JSON] InstallationBuilder))))
createInstallationBuilder ::
      f
        :- "gitlab"
          :> "installation"
          :> ReqBody '[JSON] CreateInstallationBuilderRequest
          :> auth
          :> Post '[JSON] InstallationBuilder,
    forall auth f.
GitLabAPI auth f
-> f
   :- ("gitlab"
       :> ("installations" :> (auth :> Get '[JSON] InstallationBuilders)))
getInstallationBuilders ::
      f
        :- "gitlab"
          :> "installations"
          :> auth
          :> Get '[JSON] InstallationBuilders,
    forall auth f.
GitLabAPI auth f
-> f
   :- ("gitlab"
       :> ("installation"
           :> (Capture "installationId" (Id InstallationBuilder)
               :> (auth :> Get '[JSON] InstallationBuilder))))
getInstallationBuilder ::
      f
        :- "gitlab"
          :> "installation"
          :> Capture "installationId" (Id InstallationBuilder)
          :> auth
          :> Get '[JSON] InstallationBuilder,
    forall auth f.
GitLabAPI auth f
-> f
   :- ("gitlab"
       :> ("installation"
           :> (Capture "installationId" (Id InstallationBuilder)
               :> (auth
                   :> (ReqBody '[JSON] PatchInstallationBuilder
                       :> Patch '[JSON] InstallationBuilder)))))
patchInstallationBuilder ::
      f
        :- "gitlab"
          :> "installation"
          :> Capture "installationId" (Id InstallationBuilder)
          :> auth
          :> ReqBody '[JSON] PatchInstallationBuilder
          :> Patch '[JSON] InstallationBuilder,
    forall auth f.
GitLabAPI auth f
-> f
   :- ("gitlab"
       :> ("installation"
           :> (Capture "installationId" (Id InstallationBuilder)
               :> (auth :> Delete '[JSON] NoContent))))
deleteInstallationBuilder ::
      f
        :- "gitlab"
          :> "installation"
          :> Capture "installationId" (Id InstallationBuilder)
          :> auth
          :> Delete '[JSON] NoContent,
    forall auth f.
GitLabAPI auth f
-> f
   :- ("accounts"
       :> (Capture "accountId" (Id Account)
           :> ("gitlab" :> ("install" :> (auth :> Post '[JSON] NoContent)))))
installAccount ::
      f
        :- "accounts"
          :> Capture "accountId" (Id Account)
          :> "gitlab"
          :> "install"
          :> auth
          :> Post '[JSON] NoContent,
    forall auth f.
GitLabAPI auth f
-> f
   :- ("accounts"
       :> (Capture "accountId" (Id Account)
           :> ("gitlab"
               :> ("deinstall" :> (auth :> Post '[JSON] NoContent)))))
deinstallAccount ::
      f
        :- "accounts"
          :> Capture "accountId" (Id Account)
          :> "gitlab"
          :> "deinstall"
          :> auth
          :> Post '[JSON] NoContent
  }
  deriving ((forall x. GitLabAPI auth f -> Rep (GitLabAPI auth f) x)
-> (forall x. Rep (GitLabAPI auth f) x -> GitLabAPI auth f)
-> Generic (GitLabAPI auth f)
forall x. Rep (GitLabAPI auth f) x -> GitLabAPI auth f
forall x. GitLabAPI auth f -> Rep (GitLabAPI auth f) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall auth f x. Rep (GitLabAPI auth f) x -> GitLabAPI auth f
forall auth f x. GitLabAPI auth f -> Rep (GitLabAPI auth f) x
$cfrom :: forall auth f x. GitLabAPI auth f -> Rep (GitLabAPI auth f) x
from :: forall x. GitLabAPI auth f -> Rep (GitLabAPI auth f) x
$cto :: forall auth f x. Rep (GitLabAPI auth f) x -> GitLabAPI auth f
to :: forall x. Rep (GitLabAPI auth f) x -> GitLabAPI auth f
Generic)