Plaid.Utils (plaid v2.5.0) View Source

Utility functions.

Link to this section Summary

Functions

Handles Plaid response and maps to the correct data structure.

Maps an endpoint's response to the corresponding internal data structure.

Link to this section Types

Specs

endpoint() :: atom()

Specs

response() :: %{required(String.t()) => any()}

Link to this section Functions

Link to this function

handle_resp(arg, endpoint)

View Source

Specs

handle_resp(
  {:ok, HTTPoison.Response.t()} | {:error, HTTPoison.Error.t()},
  endpoint()
) :: {:ok, any()} | {:error, Plaid.Error.t() | HTTPoison.Error.t()}

Handles Plaid response and maps to the correct data structure.

Link to this function

map_response(response, atom)

View Source

Specs

map_response(response(), endpoint()) :: any()

Maps an endpoint's response to the corresponding internal data structure.