upvest v0.1.1 Upvest.Client View Source

A module for composing authentication and request parameters to the Upvest API.

Currently encompasses key authentication and OAuth authenticationrequired for Tenancy and CLientele APIs respetively. Generally intended to passed in as parameter to Upvest.request/4.

It's implemented such that you can change the authentication parameter and retain the other configs for requests to other APIs. At a minimum, the authentication config must be present

The default BASE_URL for both authentication objects is https://api.playground.upvest.co, but feel free to adjust it, in addition to additional parameters such as extra HTTP headers and http timeout on the client struct.

Link to this section Summary

Functions

Returns a new client

Returns a new client with the given authentication

Returns a new client with the given authentication and base url

Link to this section Types

Link to this type

t()

View Source
t() :: %Upvest.Client{
  auth: auth() | nil,
  base_url: binary(),
  headers: map(),
  timeout: non_neg_integer()
}

Link to this section Functions

Link to this function

build_url(client, path)

View Source
build_url(Upvest.Client.t(), binary()) :: binary()

Returns a new client

Returns a new client with the given authentication

Link to this function

new(auth, base_url)

View Source
new(auth(), binary()) :: t()
new(auth(), binary()) :: t()
new(auth(), binary()) :: t()

Returns a new client with the given authentication and base url

Link to this function

versioned_url(path)

View Source
versioned_url(path :: binary()) :: binary()