{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData    #-}
module Network.MessagePack.Capabilities
    ( ServerCapability (..)
    , ClientCapability (..)
    ) where

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


data ServerCapability
    = SCapMethodList
      -- ^ Server supports method lists and can handle more efficient method codes
      -- instead of strings for names. It supports the "internal.methodList" call
      -- to return an ordered list of method names. The client can send an index
      -- in this list instead of the name itself when performing an RPC call.
    deriving (ServerCapability -> ServerCapability -> Bool
(ServerCapability -> ServerCapability -> Bool)
-> (ServerCapability -> ServerCapability -> Bool)
-> Eq ServerCapability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerCapability -> ServerCapability -> Bool
$c/= :: ServerCapability -> ServerCapability -> Bool
== :: ServerCapability -> ServerCapability -> Bool
$c== :: ServerCapability -> ServerCapability -> Bool
Eq, (forall x. ServerCapability -> Rep ServerCapability x)
-> (forall x. Rep ServerCapability x -> ServerCapability)
-> Generic ServerCapability
forall x. Rep ServerCapability x -> ServerCapability
forall x. ServerCapability -> Rep ServerCapability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServerCapability x -> ServerCapability
$cfrom :: forall x. ServerCapability -> Rep ServerCapability x
Generic)

instance MessagePack ServerCapability


data ClientCapability
    = CCapMethodList
      -- ^ Client supports method lists and can send more efficient method codes
      -- instead of strings for names.
    deriving (ClientCapability -> ClientCapability -> Bool
(ClientCapability -> ClientCapability -> Bool)
-> (ClientCapability -> ClientCapability -> Bool)
-> Eq ClientCapability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientCapability -> ClientCapability -> Bool
$c/= :: ClientCapability -> ClientCapability -> Bool
== :: ClientCapability -> ClientCapability -> Bool
$c== :: ClientCapability -> ClientCapability -> Bool
Eq, (forall x. ClientCapability -> Rep ClientCapability x)
-> (forall x. Rep ClientCapability x -> ClientCapability)
-> Generic ClientCapability
forall x. Rep ClientCapability x -> ClientCapability
forall x. ClientCapability -> Rep ClientCapability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClientCapability x -> ClientCapability
$cfrom :: forall x. ClientCapability -> Rep ClientCapability x
Generic)

instance MessagePack ClientCapability