module Chiasma.Codec.Data.Session where

import Chiasma.Codec (TmuxCodec)
import Chiasma.Data.TmuxId (SessionId)

-- must be data for now because of how derivation of `TmuxCodec` is implemented
data Session =
  Session {
    Session -> SessionId
sessionId :: SessionId,
    Session -> Text
sessionName :: Text
  }
  deriving stock (Session -> Session -> Bool
(Session -> Session -> Bool)
-> (Session -> Session -> Bool) -> Eq Session
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Session -> Session -> Bool
== :: Session -> Session -> Bool
$c/= :: Session -> Session -> Bool
/= :: Session -> Session -> Bool
Eq, Int -> Session -> ShowS
[Session] -> ShowS
Session -> String
(Int -> Session -> ShowS)
-> (Session -> String) -> ([Session] -> ShowS) -> Show Session
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Session -> ShowS
showsPrec :: Int -> Session -> ShowS
$cshow :: Session -> String
show :: Session -> String
$cshowList :: [Session] -> ShowS
showList :: [Session] -> ShowS
Show, (forall x. Session -> Rep Session x)
-> (forall x. Rep Session x -> Session) -> Generic Session
forall x. Rep Session x -> Session
forall x. Session -> Rep Session x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Session -> Rep Session x
from :: forall x. Session -> Rep Session x
$cto :: forall x. Rep Session x -> Session
to :: forall x. Rep Session x -> Session
Generic)
  deriving anyclass (TmuxQuery
Text -> Either DecodeError Session
(Text -> Either DecodeError Session)
-> TmuxQuery -> TmuxCodec Session
forall a.
(Text -> Either DecodeError a) -> TmuxQuery -> TmuxCodec a
$cdecode :: Text -> Either DecodeError Session
decode :: Text -> Either DecodeError Session
$cquery :: TmuxQuery
query :: TmuxQuery
TmuxCodec)