AppBlockList.Response (AppBlockList v1.0.0)

Copy Markdown View Source

Pure translation of an HTTP status and body into a result. No network.

Summary

Functions

Parses a raw response body (binary or already decoded map).

Functions

parse(status, body)

@spec parse(non_neg_integer(), binary() | map()) ::
  {:ok, AppBlockList.App.t()} | {:error, AppBlockList.Error.t()}

Parses a raw response body (binary or already decoded map).

Returns {:ok, %AppBlockList.App{}} for 200 and 404 (with found: false), and {:error, %AppBlockList.Error{}} for everything else.