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

Calamity.HTTP.Internal.Types

Description

Types for the http lib

Documentation

data RestError Source #

Constructors

HTTPError 

Fields

DecodeError Text 

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.4.3-inplace" 'False) (C1 ('MetaCons "HTTPError" 'PrefixI 'True) (S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "response") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value))) :+: C1 ('MetaCons "DecodeError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data RateLimitState Source #

Constructors

RateLimitState 

Fields

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.4.3-inplace" 'False) (C1 ('MetaCons "RateLimitState" 'PrefixI 'True) (S1 ('MetaSel ('Just "rateLimits") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Route Lock)) :*: S1 ('MetaSel ('Just "globalLock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (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

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

Methods

parseJSON :: Value -> Parser GatewayResponse

parseJSONList :: Value -> Parser [GatewayResponse]

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.4.3-inplace" 'True) (C1 ('MetaCons "GatewayResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data BotGatewayResponse Source #

Instances

Instances details
Show BotGatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Generic BotGatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Associated Types

type Rep BotGatewayResponse :: Type -> Type #

FromJSON BotGatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Methods

parseJSON :: Value -> Parser BotGatewayResponse

parseJSONList :: Value -> Parser [BotGatewayResponse]

type Rep BotGatewayResponse Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

type Rep BotGatewayResponse = D1 ('MetaData "BotGatewayResponse" "Calamity.HTTP.Internal.Types" "calamity-0.1.4.3-inplace" 'False) (C1 ('MetaCons "BotGatewayResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "shards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))