-- |
-- 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.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.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 = "api" :> "v1" :> ToServantApi PowerDNS

data PowerDNS f = PowerDNS
  { PowerDNS f -> f :- ToServantApi ServersAPI
servers    :: f :- ToServantApi ServersAPI
  , PowerDNS f -> f :- ToServantApi ZonesAPI
zones      :: f :- ToServantApi ZonesAPI
  , PowerDNS f -> f :- ToServantApi CryptokeysAPI
cryptokeys :: f :- ToServantApi CryptokeysAPI
  , PowerDNS f -> f :- ToServantApi MetadataAPI
metadata   :: f :- ToServantApi MetadataAPI
  , PowerDNS f -> f :- ToServantApi TSIGKeysAPI
tsigkeys   :: f :- 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