Pluggy.Loans (PluggyAI v0.1.0)

Copy Markdown View Source

Functions for interacting with the Pluggy Loans API.

Summary

Functions

get(client, id)

@spec get(Pluggy.Client.t(), String.t()) :: {:ok, term()} | {:error, Pluggy.Error.t()}

Gets a loan by ID.

get!(client, id)

@spec get!(Pluggy.Client.t(), String.t()) :: term()

list(client, item_id, opts \\ [])

@spec list(Pluggy.Client.t(), String.t(), keyword()) ::
  {:ok, term()} | {:error, Pluggy.Error.t()}

Lists loans for a given item.

list!(client, item_id, opts \\ [])

@spec list!(Pluggy.Client.t(), String.t(), keyword()) :: term()

list_with_cursor(client, item_id, opts \\ [])

@spec list_with_cursor(Pluggy.Client.t(), String.t(), keyword()) ::
  {:ok, map(), Pluggy.HTTP.Cursor.t() | nil} | {:error, Pluggy.Error.t()}

Lists loans with cursor-based pagination.

Returns {:ok, response, cursor} where cursor is a %Pluggy.HTTP.Cursor{} when more pages are available, or nil when on the last page.

Pass the cursor to Pluggy.HTTP.with_cursor/1 to fetch the next page.