A very simple library to load Trello boards, lists and cards via the Trello REST API.
Trellio.key = "Trello API Key"
Trellio.token = "User token"
Note: if either the key or token isn't set, Trellio will fail with TRError.noTokenOrAPIKey
on every request.
Trellio.getBoards() // AnyPublisher<[TRBoard], TRError>
board.getLists() // AnyPublisher<[TRList], TRError>
board.getCards() // AnyPublisher<[TRCard], TRError>
list.getBoard() // AnyPublisher<TRBoard, TRError>
list.getCards() // AnyPublisher<[TRCard], TRError>
card.getList() // AnyPublisher<TRList, TRError>
card.getBoard() // AnyPublisher<TRBoard, TRError>
TRError
is an enum
with multiple cases:
noTokenOrAPIKey
: You forgot to set the API key or token.unableToConstructURL
: Strange error, check the API key, token or id (if applicable).wrongResponse(HTTPURLResponse)
: The response code was wrong.noResponse
: Response cast to HTTPURLResponse failed, please file an issue.unknownError(Error)
: Self explanatory, has the error attached.
This project has unit tests, please run them before making a pull request. To run them, make a Secrets
object with two static variables:
static var key = "key"
static var token = "token"
Please do not commit this file.