module Calamity.Types.Model.Channel.Group (GroupChannel (..)) where
import Calamity.Internal.AesonThings
import Calamity.Internal.OverriddenVia
import Calamity.Internal.Utils
import {-# SOURCE #-} Calamity.Types.Model.Channel
import {-# SOURCE #-} Calamity.Types.Model.Channel.Message
import Calamity.Types.Model.User
import Calamity.Types.Snowflake
import Data.Aeson
import Data.Text (Text)
import Data.Time
import Data.Vector.Unboxing (Vector)
import GHC.Generics
import TextShow
import qualified TextShow.Generic as TSG
data GroupChannel' = GroupChannel'
{ GroupChannel' -> Snowflake GroupChannel
id :: Snowflake GroupChannel
, GroupChannel' -> Snowflake User
ownerID :: Snowflake User
, GroupChannel' -> Maybe (Snowflake Message)
lastMessageID :: Maybe (Snowflake Message)
, GroupChannel' -> Maybe (CalamityFromStringShow UTCTime)
lastPinTimestamp :: Maybe (CalamityFromStringShow UTCTime)
, GroupChannel' -> Maybe Text
icon :: Maybe Text
, GroupChannel' -> AesonVector (Snowflake User)
recipients :: AesonVector (Snowflake User)
, GroupChannel' -> Text
name :: Text
}
deriving ((forall x. GroupChannel' -> Rep GroupChannel' x)
-> (forall x. Rep GroupChannel' x -> GroupChannel')
-> Generic GroupChannel'
forall x. Rep GroupChannel' x -> GroupChannel'
forall x. GroupChannel' -> Rep GroupChannel' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupChannel' x -> GroupChannel'
$cfrom :: forall x. GroupChannel' -> Rep GroupChannel' x
Generic)
deriving (Int -> GroupChannel' -> Builder
Int -> GroupChannel' -> Text
Int -> GroupChannel' -> Text
[GroupChannel'] -> Builder
[GroupChannel'] -> Text
[GroupChannel'] -> Text
GroupChannel' -> Builder
GroupChannel' -> Text
GroupChannel' -> Text
(Int -> GroupChannel' -> Builder)
-> (GroupChannel' -> Builder)
-> ([GroupChannel'] -> Builder)
-> (Int -> GroupChannel' -> Text)
-> (GroupChannel' -> Text)
-> ([GroupChannel'] -> Text)
-> (Int -> GroupChannel' -> Text)
-> (GroupChannel' -> Text)
-> ([GroupChannel'] -> Text)
-> TextShow GroupChannel'
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [GroupChannel'] -> Text
$cshowtlList :: [GroupChannel'] -> Text
showtl :: GroupChannel' -> Text
$cshowtl :: GroupChannel' -> Text
showtlPrec :: Int -> GroupChannel' -> Text
$cshowtlPrec :: Int -> GroupChannel' -> Text
showtList :: [GroupChannel'] -> Text
$cshowtList :: [GroupChannel'] -> Text
showt :: GroupChannel' -> Text
$cshowt :: GroupChannel' -> Text
showtPrec :: Int -> GroupChannel' -> Text
$cshowtPrec :: Int -> GroupChannel' -> Text
showbList :: [GroupChannel'] -> Builder
$cshowbList :: [GroupChannel'] -> Builder
showb :: GroupChannel' -> Builder
$cshowb :: GroupChannel' -> Builder
showbPrec :: Int -> GroupChannel' -> Builder
$cshowbPrec :: Int -> GroupChannel' -> Builder
TextShow) via TSG.FromGeneric GroupChannel'
deriving ([GroupChannel'] -> Encoding
[GroupChannel'] -> Value
GroupChannel' -> Encoding
GroupChannel' -> Value
(GroupChannel' -> Value)
-> (GroupChannel' -> Encoding)
-> ([GroupChannel'] -> Value)
-> ([GroupChannel'] -> Encoding)
-> ToJSON GroupChannel'
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [GroupChannel'] -> Encoding
$ctoEncodingList :: [GroupChannel'] -> Encoding
toJSONList :: [GroupChannel'] -> Value
$ctoJSONList :: [GroupChannel'] -> Value
toEncoding :: GroupChannel' -> Encoding
$ctoEncoding :: GroupChannel' -> Encoding
toJSON :: GroupChannel' -> Value
$ctoJSON :: GroupChannel' -> Value
ToJSON, Value -> Parser [GroupChannel']
Value -> Parser GroupChannel'
(Value -> Parser GroupChannel')
-> (Value -> Parser [GroupChannel']) -> FromJSON GroupChannel'
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GroupChannel']
$cparseJSONList :: Value -> Parser [GroupChannel']
parseJSON :: Value -> Parser GroupChannel'
$cparseJSON :: Value -> Parser GroupChannel'
FromJSON) via CalamityJSON GroupChannel'
data GroupChannel = GroupChannel
{ GroupChannel -> Snowflake GroupChannel
id :: Snowflake GroupChannel
, GroupChannel -> Snowflake User
ownerID :: Snowflake User
, GroupChannel -> Maybe (Snowflake Message)
lastMessageID :: Maybe (Snowflake Message)
, GroupChannel -> Maybe UTCTime
lastPinTimestamp :: Maybe UTCTime
, GroupChannel -> Maybe Text
icon :: Maybe Text
, GroupChannel -> Vector (Snowflake User)
recipients :: Vector (Snowflake User)
, GroupChannel -> Text
name :: Text
}
deriving (Int -> GroupChannel -> ShowS
[GroupChannel] -> ShowS
GroupChannel -> String
(Int -> GroupChannel -> ShowS)
-> (GroupChannel -> String)
-> ([GroupChannel] -> ShowS)
-> Show GroupChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupChannel] -> ShowS
$cshowList :: [GroupChannel] -> ShowS
show :: GroupChannel -> String
$cshow :: GroupChannel -> String
showsPrec :: Int -> GroupChannel -> ShowS
$cshowsPrec :: Int -> GroupChannel -> ShowS
Show, GroupChannel -> GroupChannel -> Bool
(GroupChannel -> GroupChannel -> Bool)
-> (GroupChannel -> GroupChannel -> Bool) -> Eq GroupChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupChannel -> GroupChannel -> Bool
$c/= :: GroupChannel -> GroupChannel -> Bool
== :: GroupChannel -> GroupChannel -> Bool
$c== :: GroupChannel -> GroupChannel -> Bool
Eq, (forall x. GroupChannel -> Rep GroupChannel x)
-> (forall x. Rep GroupChannel x -> GroupChannel)
-> Generic GroupChannel
forall x. Rep GroupChannel x -> GroupChannel
forall x. GroupChannel -> Rep GroupChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupChannel x -> GroupChannel
$cfrom :: forall x. GroupChannel -> Rep GroupChannel x
Generic)
deriving (Int -> GroupChannel -> Builder
Int -> GroupChannel -> Text
Int -> GroupChannel -> Text
[GroupChannel] -> Builder
[GroupChannel] -> Text
[GroupChannel] -> Text
GroupChannel -> Builder
GroupChannel -> Text
GroupChannel -> Text
(Int -> GroupChannel -> Builder)
-> (GroupChannel -> Builder)
-> ([GroupChannel] -> Builder)
-> (Int -> GroupChannel -> Text)
-> (GroupChannel -> Text)
-> ([GroupChannel] -> Text)
-> (Int -> GroupChannel -> Text)
-> (GroupChannel -> Text)
-> ([GroupChannel] -> Text)
-> TextShow GroupChannel
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [GroupChannel] -> Text
$cshowtlList :: [GroupChannel] -> Text
showtl :: GroupChannel -> Text
$cshowtl :: GroupChannel -> Text
showtlPrec :: Int -> GroupChannel -> Text
$cshowtlPrec :: Int -> GroupChannel -> Text
showtList :: [GroupChannel] -> Text
$cshowtList :: [GroupChannel] -> Text
showt :: GroupChannel -> Text
$cshowt :: GroupChannel -> Text
showtPrec :: Int -> GroupChannel -> Text
$cshowtPrec :: Int -> GroupChannel -> Text
showbList :: [GroupChannel] -> Builder
$cshowbList :: [GroupChannel] -> Builder
showb :: GroupChannel -> Builder
$cshowb :: GroupChannel -> Builder
showbPrec :: Int -> GroupChannel -> Builder
$cshowbPrec :: Int -> GroupChannel -> Builder
TextShow, [GroupChannel] -> Encoding
[GroupChannel] -> Value
GroupChannel -> Encoding
GroupChannel -> Value
(GroupChannel -> Value)
-> (GroupChannel -> Encoding)
-> ([GroupChannel] -> Value)
-> ([GroupChannel] -> Encoding)
-> ToJSON GroupChannel
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [GroupChannel] -> Encoding
$ctoEncodingList :: [GroupChannel] -> Encoding
toJSONList :: [GroupChannel] -> Value
$ctoJSONList :: [GroupChannel] -> Value
toEncoding :: GroupChannel -> Encoding
$ctoEncoding :: GroupChannel -> Encoding
toJSON :: GroupChannel -> Value
$ctoJSON :: GroupChannel -> Value
ToJSON, Value -> Parser [GroupChannel]
Value -> Parser GroupChannel
(Value -> Parser GroupChannel)
-> (Value -> Parser [GroupChannel]) -> FromJSON GroupChannel
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GroupChannel]
$cparseJSONList :: Value -> Parser [GroupChannel]
parseJSON :: Value -> Parser GroupChannel
$cparseJSON :: Value -> Parser GroupChannel
FromJSON) via OverriddenVia GroupChannel GroupChannel'
deriving (HasID GroupChannel) via HasIDField "id" GroupChannel
deriving (HasID Channel) via HasIDFieldCoerce' "id" GroupChannel
deriving (HasID User) via HasIDField "ownerID" GroupChannel