Put the signature for codecs.
parent
2ad1ede8f1
commit
1457e7bf7c
|
@ -31,46 +31,54 @@ type UserID = Int -- UserID is either a login or an uid number
|
||||||
|
|
||||||
{- 0 -}
|
{- 0 -}
|
||||||
type Login = { token :: String }
|
type Login = { token :: String }
|
||||||
|
codecLogin ∷ CA.JsonCodec Login
|
||||||
codecLogin = CA.object "Login" (CAR.record { token: CA.string })
|
codecLogin = CA.object "Login" (CAR.record { token: CA.string })
|
||||||
|
|
||||||
{- 7 -}
|
{- 7 -}
|
||||||
type Maintenance = { subject :: MaintenanceSubject.MaintenanceSubject, value :: Maybe Int }
|
type Maintenance = { subject :: MaintenanceSubject.MaintenanceSubject, value :: Maybe Int }
|
||||||
|
codecMaintenance ∷ CA.JsonCodec Maintenance
|
||||||
codecMaintenance = CA.object "Maintenance" (CAR.record { subject: MaintenanceSubject.codec, value: CAR.optional CA.int })
|
codecMaintenance = CA.object "Maintenance" (CAR.record { subject: MaintenanceSubject.codec, value: CAR.optional CA.int })
|
||||||
|
|
||||||
{- 9 -}
|
{- 9 -}
|
||||||
type NewDomain = { domain :: String }
|
type NewDomain = { domain :: String }
|
||||||
|
codecNewDomain ∷ CA.JsonCodec NewDomain
|
||||||
codecNewDomain = CA.object "NewDomain" (CAR.record { domain: CA.string })
|
codecNewDomain = CA.object "NewDomain" (CAR.record { domain: CA.string })
|
||||||
|
|
||||||
{- 10 -}
|
{- 10 -}
|
||||||
type AddOrUpdateZone = { zone :: DNSZone.DNSZone }
|
type AddOrUpdateZone = { zone :: DNSZone.DNSZone }
|
||||||
|
codecAddOrUpdateZone ∷ CA.JsonCodec AddOrUpdateZone
|
||||||
codecAddOrUpdateZone = CA.object "AddOrUpdateZone" (CAR.record { zone: DNSZone.codec })
|
codecAddOrUpdateZone = CA.object "AddOrUpdateZone" (CAR.record { zone: DNSZone.codec })
|
||||||
|
|
||||||
{- 11 -}
|
{- 11 -}
|
||||||
type DeleteZone = { domain :: String }
|
type DeleteZone = { domain :: String }
|
||||||
|
codecDeleteZone ∷ CA.JsonCodec DeleteZone
|
||||||
codecDeleteZone = CA.object "DeleteZone" (CAR.record { domain: CA.string })
|
codecDeleteZone = CA.object "DeleteZone" (CAR.record { domain: CA.string })
|
||||||
|
|
||||||
{- 12 -}
|
{- 12 -}
|
||||||
type GetZone = { domain :: String }
|
type GetZone = { domain :: String }
|
||||||
|
codecGetZone ∷ CA.JsonCodec GetZone
|
||||||
codecGetZone = CA.object "GetZone" (CAR.record { domain: CA.string })
|
codecGetZone = CA.object "GetZone" (CAR.record { domain: CA.string })
|
||||||
|
|
||||||
{- 13 -}
|
{- 13 -}
|
||||||
type UserDomains = {}
|
type UserDomains = {}
|
||||||
|
codecUserDomains ∷ CA.JsonCodec UserDomains
|
||||||
codecUserDomains = CA.object "UserDomains" (CAR.record {})
|
codecUserDomains = CA.object "UserDomains" (CAR.record {})
|
||||||
|
|
||||||
{- 14 -}
|
{- 14 -}
|
||||||
type AddRR = { domain :: String, rr :: ResourceRecord.ResourceRecord }
|
type AddRR = { domain :: String, rr :: ResourceRecord.ResourceRecord }
|
||||||
|
codecAddRR ∷ CA.JsonCodec AddRR
|
||||||
codecAddRR = CA.object "AddRR" (CAR.record { domain: CA.string, rr: ResourceRecord.codec })
|
codecAddRR = CA.object "AddRR" (CAR.record { domain: CA.string, rr: ResourceRecord.codec })
|
||||||
|
|
||||||
{- 15 -}
|
{- 15 -}
|
||||||
type UpdateRR = { domain :: String, rr :: ResourceRecord.ResourceRecord }
|
type UpdateRR = { domain :: String, rr :: ResourceRecord.ResourceRecord }
|
||||||
|
codecUpdateRR ∷ CA.JsonCodec UpdateRR
|
||||||
codecUpdateRR = CA.object "UpdateRR" (CAR.record { domain: CA.string, rr: ResourceRecord.codec })
|
codecUpdateRR = CA.object "UpdateRR" (CAR.record { domain: CA.string, rr: ResourceRecord.codec })
|
||||||
|
|
||||||
{- 16 -}
|
{- 16 -}
|
||||||
type DeleteRR = { domain :: String, rrid :: Int }
|
type DeleteRR = { domain :: String, rrid :: Int }
|
||||||
|
codecDeleteRR ∷ CA.JsonCodec DeleteRR
|
||||||
codecDeleteRR = CA.object "DeleteRR" (CAR.record { domain: CA.string, rrid: CA.int })
|
codecDeleteRR = CA.object "DeleteRR" (CAR.record { domain: CA.string, rrid: CA.int })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
RESPONSES
|
RESPONSES
|
||||||
-}
|
-}
|
||||||
|
|
Loading…
Reference in New Issue