MoneyHub.Projects (MoneyHub v1.0.0)

Copy Markdown View Source

Projects: a user-defined grouping construct (similar in spirit to a manual account) that can be created, read, updated, and deleted via the API. Projects created via the API can be deleted directly; projects created as part of a bank connection can only be removed by removing the connection.

Summary

Functions

Creates a project for the user identified by token.

Deletes a project. Only works for projects created via create/3 - projects originating from a bank connection are removed by deleting the connection (see MoneyHub.Connections.delete/3).

Fetches a single project by id.

Lists projects for the user identified by token.

Updates a project's attributes.

Types

project()

@type project() :: map()

Functions

create(config, token, attrs)

@spec create(MoneyHub.Config.t(), String.t(), map()) ::
  {:ok, project()} | {:error, MoneyHub.Error.t()}

Creates a project for the user identified by token.

delete(config, token, project_id)

@spec delete(MoneyHub.Config.t(), String.t(), String.t()) ::
  :ok | {:error, MoneyHub.Error.t()}

Deletes a project. Only works for projects created via create/3 - projects originating from a bank connection are removed by deleting the connection (see MoneyHub.Connections.delete/3).

get(config, token, project_id)

@spec get(MoneyHub.Config.t(), String.t(), String.t()) ::
  {:ok, project()} | {:error, MoneyHub.Error.t()}

Fetches a single project by id.

list(config, token)

@spec list(MoneyHub.Config.t(), String.t()) ::
  {:ok, [project()]} | {:error, MoneyHub.Error.t()}

Lists projects for the user identified by token.

update(config, token, project_id, attrs)

@spec update(MoneyHub.Config.t(), String.t(), String.t(), map()) ::
  {:ok, project()} | {:error, MoneyHub.Error.t()}

Updates a project's attributes.