The Mercury Categories API — expense categories.
Summary
Functions
Creates a new expense category. POST /categories
Deletes a category. DELETE /categories/{id}
Returns one page of categories. GET /categories
A lazy, auto-paginating stream of every category.
Renames a category. PUT /categories/{id}
Functions
@spec create(client :: Mercury.Client.t(), attrs :: map() | keyword()) :: {:ok, Mercury.Category.t()} | {:error, Exception.t()}
Creates a new expense category. POST /categories
@spec create!(client :: Mercury.Client.t(), attrs :: map() | keyword()) :: Mercury.Category.t()
@spec delete(client :: Mercury.Client.t(), category_id :: String.t()) :: :ok | {:error, Exception.t()}
Deletes a category. DELETE /categories/{id}
@spec delete!(client :: Mercury.Client.t(), category_id :: String.t()) :: :ok
@spec list(client :: Mercury.Client.t(), opts :: keyword()) :: {:ok, Mercury.Page.t(Mercury.Category.t())} | {:error, Exception.t()}
Returns one page of categories. GET /categories
@spec list!(client :: Mercury.Client.t(), opts :: keyword()) :: Mercury.Page.t(Mercury.Category.t())
@spec stream(client :: Mercury.Client.t(), opts :: keyword()) :: Enumerable.t()
A lazy, auto-paginating stream of every category.
@spec update( client :: Mercury.Client.t(), category_id :: String.t(), attrs :: map() | keyword() ) :: {:ok, Mercury.Category.t()} | {:error, Exception.t()}
Renames a category. PUT /categories/{id}
@spec update!( client :: Mercury.Client.t(), category_id :: String.t(), attrs :: map() | keyword() ) :: Mercury.Category.t()