A reusable, explicit client struct.
Most functions in StarlingBank.Resources.* accept either:
- a
%StarlingBank.Client{}built withnew/1, or - a plain keyword list of opts (
access_token:,environment:, ...), or - nothing at all, in which case configuration falls back to the
application environment (see
StarlingBank.Config).
Building an explicit client is recommended whenever you talk to multiple Starling accounts/environments from the same application (e.g. a multi-tenant TPP integration).
Example
client = StarlingBank.Client.new(access_token: token, environment: :production)
{:ok, accounts} = StarlingBank.Accounts.list(client)
Summary
Functions
Builds a new client from opts. See StarlingBank.Config.new/1.
Types
@type t() :: %StarlingBank.Client{config: StarlingBank.Config.t()}
Functions
Builds a new client from opts. See StarlingBank.Config.new/1.