calamity-0.1.26.0: A library for writing discord bots in haskell
Safe HaskellNone
LanguageHaskell2010

Calamity.HTTP.Internal.Types

Description

Types for the http lib

Documentation

data RestError Source #

Constructors

HTTPError

An error response from discord

Fields

InternalClientError Text

Something failed while making the request (after retrying a few times)

Instances

Instances details
Show RestError Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Generic RestError Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Associated Types

type Rep RestError :: Type -> Type #

type Rep RestError Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

type Rep RestError = D1 ('MetaData "RestError" "Calamity.HTTP.Internal.Types" "calamity-0.1.26.0-8Rbyh2JfYBvC9UHgZLNZiA" 'False) (C1 ('MetaCons "HTTPError" 'PrefixI 'True) (S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "response") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Value))) :+: C1 ('MetaCons "InternalClientError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

data RateLimitState Source #

Constructors

RateLimitState 

Instances

Instances details
Generic RateLimitState Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Associated Types

type Rep RateLimitState :: Type -> Type #

type Rep RateLimitState Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

type Rep RateLimitState = D1 ('MetaData "RateLimitState" "Calamity.HTTP.Internal.Types" "calamity-0.1.26.0-8Rbyh2JfYBvC9UHgZLNZiA" 'False) (C1 ('MetaCons "RateLimitState" 'PrefixI 'True) (S1 ('MetaSel ('Just "rateLimits") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map Route Lock)) :*: S1 ('MetaSel ('Just "globalLock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Event)))

data DiscordResponseType Source #

Constructors

Good ByteString

A good response

ExhaustedBucket

We got a response but also exhausted the bucket

Fields

Ratelimited

We hit a 429, no response and ratelimited

Fields

  • Int

    Retry after (milliseconds)

  • Bool

    Global ratelimit

ServerError Int

Discord's error, we should retry (HTTP 5XX)

ClientError Int ByteString

Our error, we should fail

InternalResponseError Text

Something went wrong with the http client

data GatewayResponse Source #

Instances

Instances details
Show GatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Generic GatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Associated Types

type Rep GatewayResponse :: Type -> Type #

FromJSON GatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

type Rep GatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

type Rep GatewayResponse = D1 ('MetaData "GatewayResponse" "Calamity.HTTP.Internal.Types" "calamity-0.1.26.0-8Rbyh2JfYBvC9UHgZLNZiA" 'True) (C1 ('MetaCons "GatewayResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))