module Calamity.Types.Model.Channel.UpdatedMessage (
UpdatedMessage (..),
) where
import Calamity.Internal.AesonThings
import Calamity.Internal.OverriddenVia
import Calamity.Internal.Utils
import Calamity.Types.Model.Channel
import Calamity.Types.Model.Guild.Role
import Calamity.Types.Model.User
import Calamity.Types.Snowflake
import Data.Aeson
import Data.Text (Text)
import Data.Time
import qualified Data.Vector.Unboxing as UV
import Data.Word
import GHC.Generics
import TextShow
import qualified TextShow.Generic as TSG
data UpdatedMessage' = UpdatedMessage'
{ UpdatedMessage' -> Snowflake Message
id :: Snowflake Message
, UpdatedMessage' -> Snowflake Channel
channelID :: Snowflake Channel
, UpdatedMessage' -> Maybe Text
content :: Maybe Text
, UpdatedMessage'
-> Maybe (MaybeNull (CalamityFromStringShow UTCTime))
editedTimestamp :: Maybe (MaybeNull (CalamityFromStringShow UTCTime))
, UpdatedMessage' -> Maybe Bool
tts :: Maybe Bool
, UpdatedMessage' -> Maybe Bool
mentionEveryone :: Maybe Bool
, UpdatedMessage' -> Maybe (AesonVector (Snowflake User))
mentions :: Maybe (AesonVector (Snowflake User))
, UpdatedMessage' -> Maybe (AesonVector (Snowflake Role))
mentionRoles :: Maybe (AesonVector (Snowflake Role))
, UpdatedMessage' -> Maybe (AesonVector (Snowflake Channel))
mentionChannels :: Maybe (AesonVector (Snowflake Channel))
, UpdatedMessage' -> Maybe [Attachment]
attachments :: !(Maybe [Attachment])
, UpdatedMessage' -> Maybe [Embed]
embeds :: Maybe [Embed]
, UpdatedMessage' -> Maybe [Reaction]
reactions :: Maybe [Reaction]
, UpdatedMessage' -> Maybe Bool
pinned :: Maybe Bool
, UpdatedMessage' -> Maybe (MaybeNull (Snowflake Webhook))
webhookID :: Maybe (MaybeNull (Snowflake Webhook))
, UpdatedMessage' -> Maybe MessageType
type_ :: Maybe MessageType
, UpdatedMessage'
-> Maybe (MaybeNull (CalamityFromStringShow Object))
activity :: Maybe (MaybeNull (CalamityFromStringShow Object))
, UpdatedMessage'
-> Maybe (MaybeNull (CalamityFromStringShow Object))
application :: Maybe (MaybeNull (CalamityFromStringShow Object))
, UpdatedMessage' -> Maybe (MaybeNull MessageReference)
messageReference :: Maybe (MaybeNull MessageReference)
, UpdatedMessage' -> Maybe Word64
flags :: Maybe Word64
, UpdatedMessage' -> Maybe (MaybeNull Message)
referencedMessage :: Maybe (MaybeNull Message)
, UpdatedMessage'
-> Maybe (MaybeNull (CalamityFromStringShow Object))
interaction :: Maybe (MaybeNull (CalamityFromStringShow Object))
, UpdatedMessage' -> Maybe [Component]
components :: Maybe [Component]
}
deriving ((forall x. UpdatedMessage' -> Rep UpdatedMessage' x)
-> (forall x. Rep UpdatedMessage' x -> UpdatedMessage')
-> Generic UpdatedMessage'
forall x. Rep UpdatedMessage' x -> UpdatedMessage'
forall x. UpdatedMessage' -> Rep UpdatedMessage' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatedMessage' x -> UpdatedMessage'
$cfrom :: forall x. UpdatedMessage' -> Rep UpdatedMessage' x
Generic)
deriving (Int -> UpdatedMessage' -> Builder
Int -> UpdatedMessage' -> Text
Int -> UpdatedMessage' -> Text
[UpdatedMessage'] -> Builder
[UpdatedMessage'] -> Text
[UpdatedMessage'] -> Text
UpdatedMessage' -> Builder
UpdatedMessage' -> Text
UpdatedMessage' -> Text
(Int -> UpdatedMessage' -> Builder)
-> (UpdatedMessage' -> Builder)
-> ([UpdatedMessage'] -> Builder)
-> (Int -> UpdatedMessage' -> Text)
-> (UpdatedMessage' -> Text)
-> ([UpdatedMessage'] -> Text)
-> (Int -> UpdatedMessage' -> Text)
-> (UpdatedMessage' -> Text)
-> ([UpdatedMessage'] -> Text)
-> TextShow UpdatedMessage'
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 :: [UpdatedMessage'] -> Text
$cshowtlList :: [UpdatedMessage'] -> Text
showtl :: UpdatedMessage' -> Text
$cshowtl :: UpdatedMessage' -> Text
showtlPrec :: Int -> UpdatedMessage' -> Text
$cshowtlPrec :: Int -> UpdatedMessage' -> Text
showtList :: [UpdatedMessage'] -> Text
$cshowtList :: [UpdatedMessage'] -> Text
showt :: UpdatedMessage' -> Text
$cshowt :: UpdatedMessage' -> Text
showtPrec :: Int -> UpdatedMessage' -> Text
$cshowtPrec :: Int -> UpdatedMessage' -> Text
showbList :: [UpdatedMessage'] -> Builder
$cshowbList :: [UpdatedMessage'] -> Builder
showb :: UpdatedMessage' -> Builder
$cshowb :: UpdatedMessage' -> Builder
showbPrec :: Int -> UpdatedMessage' -> Builder
$cshowbPrec :: Int -> UpdatedMessage' -> Builder
TextShow) via TSG.FromGeneric UpdatedMessage'
deriving
(Value -> Parser [UpdatedMessage']
Value -> Parser UpdatedMessage'
(Value -> Parser UpdatedMessage')
-> (Value -> Parser [UpdatedMessage']) -> FromJSON UpdatedMessage'
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [UpdatedMessage']
$cparseJSONList :: Value -> Parser [UpdatedMessage']
parseJSON :: Value -> Parser UpdatedMessage'
$cparseJSON :: Value -> Parser UpdatedMessage'
FromJSON)
via WithSpecialCases
'[ "author" `ExtractFieldFrom` "id"
, "mentions" `ExtractArrayField` "id"
, "mention_channels" `ExtractArrayField` "id"
]
UpdatedMessage'
data UpdatedMessage = UpdatedMessage
{ UpdatedMessage -> Snowflake Message
id :: Snowflake Message
, UpdatedMessage -> Snowflake Channel
channelID :: Snowflake Channel
, UpdatedMessage -> Maybe Text
content :: Maybe Text
, UpdatedMessage -> Maybe (MaybeNull UTCTime)
editedTimestamp :: Maybe (MaybeNull UTCTime)
, UpdatedMessage -> Maybe Bool
tts :: Maybe Bool
, UpdatedMessage -> Maybe Bool
mentionEveryone :: Maybe Bool
, UpdatedMessage -> Maybe (Vector (Snowflake User))
mentions :: Maybe (UV.Vector (Snowflake User))
, UpdatedMessage -> Maybe (Vector (Snowflake Role))
mentionRoles :: Maybe (UV.Vector (Snowflake Role))
, UpdatedMessage -> Maybe (Vector (Snowflake Channel))
mentionChannels :: Maybe (UV.Vector (Snowflake Channel))
, UpdatedMessage -> Maybe [Attachment]
attachments :: !(Maybe [Attachment])
, UpdatedMessage -> Maybe [Embed]
embeds :: Maybe [Embed]
, UpdatedMessage -> Maybe [Reaction]
reactions :: Maybe [Reaction]
, UpdatedMessage -> Maybe Bool
pinned :: Maybe Bool
, UpdatedMessage -> Maybe (MaybeNull (Snowflake Webhook))
webhookID :: Maybe (MaybeNull (Snowflake Webhook))
, UpdatedMessage -> Maybe MessageType
type_ :: Maybe MessageType
, UpdatedMessage -> Maybe (MaybeNull Object)
activity :: Maybe (MaybeNull Object)
, UpdatedMessage -> Maybe (MaybeNull Object)
application :: Maybe (MaybeNull Object)
, UpdatedMessage -> Maybe (MaybeNull MessageReference)
messageReference :: Maybe (MaybeNull MessageReference)
, UpdatedMessage -> Maybe Word64
flags :: Maybe Word64
, UpdatedMessage -> Maybe (MaybeNull Message)
referencedMessage :: Maybe (MaybeNull Message)
, UpdatedMessage -> Maybe (MaybeNull Object)
interaction :: Maybe (MaybeNull Object)
, UpdatedMessage -> Maybe [Component]
components :: Maybe [Component]
}
deriving (Int -> UpdatedMessage -> ShowS
[UpdatedMessage] -> ShowS
UpdatedMessage -> String
(Int -> UpdatedMessage -> ShowS)
-> (UpdatedMessage -> String)
-> ([UpdatedMessage] -> ShowS)
-> Show UpdatedMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatedMessage] -> ShowS
$cshowList :: [UpdatedMessage] -> ShowS
show :: UpdatedMessage -> String
$cshow :: UpdatedMessage -> String
showsPrec :: Int -> UpdatedMessage -> ShowS
$cshowsPrec :: Int -> UpdatedMessage -> ShowS
Show, (forall x. UpdatedMessage -> Rep UpdatedMessage x)
-> (forall x. Rep UpdatedMessage x -> UpdatedMessage)
-> Generic UpdatedMessage
forall x. Rep UpdatedMessage x -> UpdatedMessage
forall x. UpdatedMessage -> Rep UpdatedMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatedMessage x -> UpdatedMessage
$cfrom :: forall x. UpdatedMessage -> Rep UpdatedMessage x
Generic)
deriving (Int -> UpdatedMessage -> Builder
Int -> UpdatedMessage -> Text
Int -> UpdatedMessage -> Text
[UpdatedMessage] -> Builder
[UpdatedMessage] -> Text
[UpdatedMessage] -> Text
UpdatedMessage -> Builder
UpdatedMessage -> Text
UpdatedMessage -> Text
(Int -> UpdatedMessage -> Builder)
-> (UpdatedMessage -> Builder)
-> ([UpdatedMessage] -> Builder)
-> (Int -> UpdatedMessage -> Text)
-> (UpdatedMessage -> Text)
-> ([UpdatedMessage] -> Text)
-> (Int -> UpdatedMessage -> Text)
-> (UpdatedMessage -> Text)
-> ([UpdatedMessage] -> Text)
-> TextShow UpdatedMessage
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 :: [UpdatedMessage] -> Text
$cshowtlList :: [UpdatedMessage] -> Text
showtl :: UpdatedMessage -> Text
$cshowtl :: UpdatedMessage -> Text
showtlPrec :: Int -> UpdatedMessage -> Text
$cshowtlPrec :: Int -> UpdatedMessage -> Text
showtList :: [UpdatedMessage] -> Text
$cshowtList :: [UpdatedMessage] -> Text
showt :: UpdatedMessage -> Text
$cshowt :: UpdatedMessage -> Text
showtPrec :: Int -> UpdatedMessage -> Text
$cshowtPrec :: Int -> UpdatedMessage -> Text
showbList :: [UpdatedMessage] -> Builder
$cshowbList :: [UpdatedMessage] -> Builder
showb :: UpdatedMessage -> Builder
$cshowb :: UpdatedMessage -> Builder
showbPrec :: Int -> UpdatedMessage -> Builder
$cshowbPrec :: Int -> UpdatedMessage -> Builder
TextShow, Value -> Parser [UpdatedMessage]
Value -> Parser UpdatedMessage
(Value -> Parser UpdatedMessage)
-> (Value -> Parser [UpdatedMessage]) -> FromJSON UpdatedMessage
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [UpdatedMessage]
$cparseJSONList :: Value -> Parser [UpdatedMessage]
parseJSON :: Value -> Parser UpdatedMessage
$cparseJSON :: Value -> Parser UpdatedMessage
FromJSON) via OverriddenVia UpdatedMessage UpdatedMessage'
deriving (HasID Message) via HasIDField "id" UpdatedMessage
deriving (HasID Channel) via HasIDField "channelID" UpdatedMessage