Immich. API. Client
(ex_immich v0.1.1)
Copy Markdown
Generic HTTP client for Immich API requests.
Summary
Functions
Sends a JSON GET request and returns the decoded JSON body for 2xx responses.
Sends a streaming JSON POST request and decodes the response as NDJSON.
Sends a JSON POST request and returns the decoded JSON body for 2xx responses.
Types
@type api_error() :: {:authentication, term()} | {:authorization, term()} | {:transport, term()} | {:unexpected_response, non_neg_integer(), term()}
@type request_fun() :: (keyword() -> {:ok, Req.Response.t()} | {:error, term()})
@type t() :: module()
Functions
Sends a JSON GET request and returns the decoded JSON body for 2xx responses.
Non-2xx responses are mapped to typed API error tuples.
@spec ndjson_stream(String.t(), map(), headers()) :: {:ok, Enumerable.t(map())} | {:error, api_error()}
Sends a streaming JSON POST request and decodes the response as NDJSON.
Returns a lazy stream of decoded map events for 2xx responses.
@spec ndjson_stream(String.t(), map(), headers(), request_fun()) :: {:ok, Enumerable.t(map())} | {:error, api_error()}
Sends a JSON POST request and returns the decoded JSON body for 2xx responses.
Non-2xx responses are mapped to typed API error tuples.