Exact.RateLimit (exact_online v0.1.0)

Copy Markdown View Source

Rate limit state as reported by Exact Online response headers.

Exact Online enforces both a daily and a minutely limit per division. The ceilings depend on your agreement, so this struct reports what the API says rather than assuming a fixed number.

Reset timestamps are sent as Unix milliseconds and are exposed as DateTime structs.

Summary

Functions

Parses the rate limit headers off a Req.Response.

Types

t()

@type t() :: %Exact.RateLimit{
  limit: integer() | nil,
  minutely_limit: integer() | nil,
  minutely_remaining: integer() | nil,
  minutely_reset: DateTime.t() | nil,
  remaining: integer() | nil,
  reset: DateTime.t() | nil
}

Functions

from_response(response)

@spec from_response(Req.Response.t()) :: t()

Parses the rate limit headers off a Req.Response.