-- |
-- Module: PowerDNS.API
-- Description: Servant based wrapper for PowerDNS.
--
-- This module exports a complete servant API description of the PowerDNS. May be useful to some.

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveGeneric #-}
module PowerDNS.API
  ( API
  , api
  , PowerDNS(..)
  , module PowerDNS.API.Version
  , module PowerDNS.API.Zones
  , module PowerDNS.API.Servers
  , module PowerDNS.API.Cryptokeys
  , module PowerDNS.API.Metadata
  , module PowerDNS.API.TSIGKeys
  )
where

import           GHC.Generics (Generic)
import           Data.Proxy (Proxy(..))

import           Servant.API
import           Servant.API.Generic ((:-), ToServantApi)

import           PowerDNS.API.Version
import           PowerDNS.API.Zones
import           PowerDNS.API.Servers
import           PowerDNS.API.Cryptokeys
import           PowerDNS.API.Metadata
import           PowerDNS.API.TSIGKeys

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

type API = ToServantApi PowerDNS

data PowerDNS f = PowerDNS
  { PowerDNS f -> f :- ("api" :> ToServantApi VersionsAPI)
versions   :: f :- "api" :>         ToServantApi VersionsAPI
  , PowerDNS f -> f :- ("api" :> ("v1" :> ToServantApi ServersAPI))
servers    :: f :- "api" :> "v1" :> ToServantApi ServersAPI
  , PowerDNS f -> f :- ("api" :> ("v1" :> ToServantApi ZonesAPI))
zones      :: f :- "api" :> "v1" :> ToServantApi ZonesAPI
  , PowerDNS f -> f :- ("api" :> ("v1" :> ToServantApi CryptokeysAPI))
cryptokeys :: f :- "api" :> "v1" :> ToServantApi CryptokeysAPI
  , PowerDNS f -> f :- ("api" :> ("v1" :> ToServantApi MetadataAPI))
metadata   :: f :- "api" :> "v1" :> ToServantApi MetadataAPI
  , PowerDNS f -> f :- ("api" :> ("v1" :> ToServantApi TSIGKeysAPI))
tsigkeys   :: f :- "api" :> "v1" :> ToServantApi TSIGKeysAPI
  } deriving (forall x. PowerDNS f -> Rep (PowerDNS f) x)
-> (forall x. Rep (PowerDNS f) x -> PowerDNS f)
-> Generic (PowerDNS f)
forall x. Rep (PowerDNS f) x -> PowerDNS f
forall x. PowerDNS f -> Rep (PowerDNS f) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall f x. Rep (PowerDNS f) x -> PowerDNS f
forall f x. PowerDNS f -> Rep (PowerDNS f) x
$cto :: forall f x. Rep (PowerDNS f) x -> PowerDNS f
$cfrom :: forall f x. PowerDNS f -> Rep (PowerDNS f) x
Generic