Immutable configuration for one integration/account.
Options to new/1:
:token— access token or zero-arity provider returning the current token,{:ok, token}or{:error, %ExFattureincloud.Error{}}. Omit for OAuth calls; authenticated requests then return an error.:base_url— defaults tohttps://api-v2.fattureincloud.it.:user_agent— defaults toFattureInCloud/2.1.3/Go-SDK, matching the official Go SDK's compatibility header. Override for your integration.:receive_timeout— milliseconds, default 15,000.:max_retries— additional attempts for GET/HEAD only, default 2.:retry_delay— initial backoff in milliseconds, default 500, with jitter.:max_retry_delay— maximum permitted wait, default 30,000 ms. A serverRetry-Afterabove this budget returns the error without retrying early.:req_options— Req options, e.g.connect_options,finch,plugor a customadapter. Redirects and Req's own retries are always disabled.
Token providers are evaluated once per outgoing attempt. Clients keep no global
credentials. Optional managed renewal is available through
ExFattureincloud.OAuth.TokenManager; applications supply its storage callbacks.
Inspection of the client excludes credentials and Req options.
Summary
Types
A zero-arity provider evaluated before each outgoing HTTP attempt.
A token provider's result, including structured authorization failures.
Functions
Creates and validates an immutable client configuration. Invalid options raise ArgumentError.
Types
@type t() :: %ExFattureincloud.Client{ base_url: String.t(), max_retries: non_neg_integer(), max_retry_delay: non_neg_integer(), receive_timeout: pos_integer(), req_options: keyword(), retry_delay: non_neg_integer(), token: nil | String.t() | token_provider(), user_agent: String.t() }
@type token_provider() :: (-> token_result())
A zero-arity provider evaluated before each outgoing HTTP attempt.
@type token_result() :: String.t() | {:ok, String.t()} | {:error, ExFattureincloud.Error.t()}
A token provider's result, including structured authorization failures.
Functions
Creates and validates an immutable client configuration. Invalid options raise ArgumentError.