calamity-0.1.14.1: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.HTTP.Internal.Request

Description

Generic Request type

Documentation

class Request a where Source #

Minimal complete definition

route, action

Associated Types

type Result a Source #

Methods

route :: a -> Route Source #

action :: a -> Options -> String -> IO (Response ByteString) Source #

invoke :: (BotC r, FromJSON (Result a)) => a -> Sem r (Either RestError (Result a)) Source #

Instances

Instances details
Request (WebhookRequest a) Source # 
Instance details

Defined in Calamity.HTTP.Webhook

Associated Types

type Result (WebhookRequest a) Source #

Methods

route :: WebhookRequest a -> Route Source #

action :: WebhookRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (WebhookRequest a))) => WebhookRequest a -> Sem r (Either RestError (Result (WebhookRequest a))) Source #

Request (UserRequest a) Source # 
Instance details

Defined in Calamity.HTTP.User

Associated Types

type Result (UserRequest a) Source #

Methods

route :: UserRequest a -> Route Source #

action :: UserRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (UserRequest a))) => UserRequest a -> Sem r (Either RestError (Result (UserRequest a))) Source #

Request a => Request (Reason a) Source # 
Instance details

Defined in Calamity.HTTP.Reason

Associated Types

type Result (Reason a) Source #

Methods

route :: Reason a -> Route Source #

action :: Reason a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (Reason a))) => Reason a -> Sem r (Either RestError (Result (Reason a))) Source #

Request (MiscRequest a) Source # 
Instance details

Defined in Calamity.HTTP.MiscRoutes

Associated Types

type Result (MiscRequest a) Source #

Methods

route :: MiscRequest a -> Route Source #

action :: MiscRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (MiscRequest a))) => MiscRequest a -> Sem r (Either RestError (Result (MiscRequest a))) Source #

Request (InviteRequest a) Source # 
Instance details

Defined in Calamity.HTTP.Invite

Associated Types

type Result (InviteRequest a) Source #

Methods

route :: InviteRequest a -> Route Source #

action :: InviteRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (InviteRequest a))) => InviteRequest a -> Sem r (Either RestError (Result (InviteRequest a))) Source #

Request (GuildRequest a) Source # 
Instance details

Defined in Calamity.HTTP.Guild

Associated Types

type Result (GuildRequest a) Source #

Methods

route :: GuildRequest a -> Route Source #

action :: GuildRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (GuildRequest a))) => GuildRequest a -> Sem r (Either RestError (Result (GuildRequest a))) Source #

Request (EmojiRequest a) Source # 
Instance details

Defined in Calamity.HTTP.Emoji

Associated Types

type Result (EmojiRequest a) Source #

Methods

route :: EmojiRequest a -> Route Source #

action :: EmojiRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (EmojiRequest a))) => EmojiRequest a -> Sem r (Either RestError (Result (EmojiRequest a))) Source #

Request (ChannelRequest a) Source # 
Instance details

Defined in Calamity.HTTP.Channel

Associated Types

type Result (ChannelRequest a) Source #

Methods

route :: ChannelRequest a -> Route Source #

action :: ChannelRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (ChannelRequest a))) => ChannelRequest a -> Sem r (Either RestError (Result (ChannelRequest a))) Source #

Request (AuditLogRequest a) Source # 
Instance details

Defined in Calamity.HTTP.AuditLog

Associated Types

type Result (AuditLogRequest a) Source #

Methods

route :: AuditLogRequest a -> Route Source #

action :: AuditLogRequest a -> Options -> String -> IO (Response ByteString) Source #

invoke :: forall (r :: [(Type -> Type) -> Type -> Type]). (BotC r, FromJSON (Result (AuditLogRequest a))) => AuditLogRequest a -> Sem r (Either RestError (Result (AuditLogRequest a))) Source #

postWith' :: Postable a => a -> Options -> String -> IO (Response ByteString) Source #

postWithP' :: Postable a => a -> (Options -> Options) -> Options -> String -> IO (Response ByteString) Source #

putWith' :: Putable a => a -> Options -> String -> IO (Response ByteString) Source #

patchWith' :: Patchable a => a -> Options -> String -> IO (Response ByteString) Source #

putEmpty :: Options -> String -> IO (Response ByteString) Source #

putEmptyP :: (Options -> Options) -> Options -> String -> IO (Response ByteString) Source #

postEmpty :: Options -> String -> IO (Response ByteString) Source #

postEmptyP :: (Options -> Options) -> Options -> String -> IO (Response ByteString) Source #

getWithP :: (Options -> Options) -> Options -> String -> IO (Response ByteString) Source #