-- |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 (Object -> Either DecodeError CommandMods
(Object -> Either DecodeError CommandMods)
-> MsgpackDecode CommandMods
forall a. (Object -> Either DecodeError a) -> MsgpackDecode a
fromMsgpack :: Object -> Either DecodeError CommandMods
$cfromMsgpack :: Object -> Either DecodeError CommandMods
MsgpackDecode)