Internal utility helpers shared across all Tink API modules.
Not part of the public API surface — subject to change without notice.
Summary
Functions
Standard pagination params from opts.
Build a params map from a keyword list, mapping atom keys to camelCase strings.
Hash a params map to a stable string for use in cache keys.
Poll fetch_fn repeatedly until it returns a response matching done_statuses,
or until the deadline is exceeded.
Put value into map under key only when value is not nil.
Put a list as a comma-joined string, only when list is not nil.
A short prefix derived from a client token — used to scope cache keys per user session. Not a security boundary; purely for key namespacing.
Functions
Standard pagination params from opts.
Build a params map from a keyword list, mapping atom keys to camelCase strings.
Hash a params map to a stable string for use in cache keys.
@spec poll_until( fetch_fn :: (-> {:ok, map()} | {:error, any()}), done_statuses :: [String.t()], opts :: keyword() ) :: {:ok, map()} | {:error, Tink.Error.t() | :timeout}
Poll fetch_fn repeatedly until it returns a response matching done_statuses,
or until the deadline is exceeded.
Returns {:ok, response} on success, {:error, :timeout} on deadline, or
{:error, %Tink.Error{}} if the fetch_fn returns an error status.
Options
:timeout_ms— max wait time in ms (default: 30_000):interval_ms— sleep between polls in ms (default: 1_000):failed_statuses— list of statuses that mean terminal failure (default:["FAILED", "ERROR"])
Put value into map under key only when value is not nil.
Put a list as a comma-joined string, only when list is not nil.
@spec token_prefix(Tink.Client.t()) :: String.t()
A short prefix derived from a client token — used to scope cache keys per user session. Not a security boundary; purely for key namespacing.