-- |Special command parameter that exposes the used modifiers.
module Ribosome.Host.Data.CommandMods where

import Ribosome.Host.Class.Msgpack.Decode (MsgpackDecode)

-- |When this type is used as a parameter of a command handler function, the RPC trigger uses the special token
-- @<q-mods>@ in the call.
--
-- This type then contains the list of pre-command modifiers specified by the user, like @:belowright@.
newtype CommandMods =
  CommandMods { CommandMods -> Text
unCommandMods :: Text }
  deriving stock (CommandMods -> CommandMods -> Bool
(CommandMods -> CommandMods -> Bool)
-> (CommandMods -> CommandMods -> Bool) -> Eq CommandMods
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommandMods -> CommandMods -> Bool
$c/= :: CommandMods -> CommandMods -> Bool
== :: CommandMods -> CommandMods -> Bool
$c== :: CommandMods -> CommandMods -> Bool
Eq, Int -> CommandMods -> ShowS
[CommandMods] -> ShowS
CommandMods -> String
(Int -> CommandMods -> ShowS)
-> (CommandMods -> String)
-> ([CommandMods] -> ShowS)
-> Show CommandMods
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommandMods] -> ShowS
$cshowList :: [CommandMods] -> ShowS
show :: CommandMods -> String
$cshow :: CommandMods -> String
showsPrec :: Int -> CommandMods -> ShowS
$cshowsPrec :: Int -> CommandMods -> ShowS
Show)
  deriving newtype (String -> Object -> Either Text CommandMods
Object -> Either Text CommandMods
(Object -> Either Text CommandMods)
-> (String -> Object -> Either Text CommandMods)
-> MsgpackDecode CommandMods
forall a.
(Object -> Either Text a)
-> (String -> Object -> Either Text a) -> MsgpackDecode a
missingKey :: String -> Object -> Either Text CommandMods
$cmissingKey :: String -> Object -> Either Text CommandMods
fromMsgpack :: Object -> Either Text CommandMods
$cfromMsgpack :: Object -> Either Text CommandMods
MsgpackDecode)