+-- | Class of objects that have timestamps.
+class TimeStampObject a where
+ cTimeOf :: a -> Double
+ mTimeOf :: a -> Double
+
+-- | Class of objects that have an UUID.
+class UuidObject a where
+ uuidOf :: a -> String
+
+-- | Class of object that have a serial number.
+class SerialNoObject a where
+ serialOf :: a -> Int
+
+-- | Class of objects that have tags.
+class TagsObject a where
+ tagsOf :: a -> Set.Set String
+
+-- * Node role object
+
+$(declareSADT "NodeRole"
+ [ ("NROffline", 'C.nrOffline)
+ , ("NRDrained", 'C.nrDrained)
+ , ("NRRegular", 'C.nrRegular)
+ , ("NRCandidate", 'C.nrMcandidate)
+ , ("NRMaster", 'C.nrMaster)
+ ])
+$(makeJSONInstance ''NodeRole)
+
+-- | The description of the node role.
+roleDescription :: NodeRole -> String
+roleDescription NROffline = "offline"
+roleDescription NRDrained = "drained"
+roleDescription NRRegular = "regular"
+roleDescription NRCandidate = "master candidate"
+roleDescription NRMaster = "master"
+