ExClubhouse

buildCoverage Status

Clubhouse client library for Elixir πŸ§™β€β™‚οΈ

Uses Clubhouse REST API V3: https://clubhouse.io/api/rest/v3/

Installation

Add exclubhouse to your list of dependencies in mix.exs:

def deps do
[
{:exclubhouse, "~> 0.5.0"}
]
end

Setup and basic usage

1. Add an API token in your config

config :exclubhouse,
token: "xxxxx-xxxx-xxxx-xxx-xxx"

2. Use the API

alias ExClubhouse.{Api, Model}
epic_input = Input.Epic{
name: "Your first Epic",
description: "Some description for the epic"
}
Api.Epic.create(epic_input)

Output example:

{:ok,
%ExClubhouse.Model.Epic{
app_url: "https://app.clubhouse.io/kamehouse/epic/22",
description: "Some description for the epic",
id: 22,
name: "Your first Epic",
...
updated_at: "2020-03-15T21:43:04Z"
}}

You can find all API grouped under ExClubhouse.Api

Custom usage

In some cases we want to use different tokens for the same call, use the response as-is or simply debug a call to the API using iEx. For those case we can build the API call like this:

  1. Build a session
  2. Create an operation
  3. Pass the operation and session to the client to make a request
  4. Parse the client's result

E.g.

alias ExClubhouse.{Api, Client, Session, Config, Model, Parse}
# 1. Get a default session from the config
sess = Config.default() |> Session.from()
# Or Build it passing the actual token
sess = %Session{token: "xxxxx-xxxx-xxxx-xxx-xxx"}
# 2. Build the operation
op = Ops.Epic.get(42)
# 3. Make the request
result = Client.HTTP.request(op, sess)
# 4 Parse the result
{:ok, %Model.Epic{} = epic42} = Parser.parse(result)

Design guidelines

Here's a list of design guidelines used in the project:

Project roadmap

Next: v0.6.0

The upcoming versions will complete the following functionality, add better tests and increase coverage.

Current: v0.5.1

Previous

v0.5.0

License

Please see LICENSE for licensing details.