Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itemconsulting/reactive-timely
A Java library to access Timely in a reactive manner
https://github.com/itemconsulting/reactive-timely
Last synced: 14 days ago
JSON representation
A Java library to access Timely in a reactive manner
- Host: GitHub
- URL: https://github.com/itemconsulting/reactive-timely
- Owner: ItemConsulting
- License: gpl-3.0
- Created: 2015-04-17T07:10:09.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-15T09:00:21.000Z (over 9 years ago)
- Last Synced: 2024-11-12T07:16:14.991Z (2 months ago)
- Language: Java
- Homepage:
- Size: 215 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reactive Timely
A Java library to access timely in a reactive manner## Usage
```java
Long timeout = 2000L;
String baseUrl = "https://mypage.timelyapp.com";
String authURL = baseUrl + "/api/v1/oauth/authorize";
String tokenURL = baseUrl + "/api/v1/oauth/token";// this object's used to hold the refresh token (and pzzt... you can save it persistently)
RefreshTokenHolder refreshTokenHolder = new SimpleRefreshTokenHolder();// sets up an oauth client that will do the request-token stuff for you
OAuthClient client = OAuthClient.create(authURL, tokenURL)
.clientId("...")
.clientSecret("...")
.redirectUri("http://localhost")
.refreshTokenHolder(refreshTokenHolder)
.build();// this is your timely service
TimelyService timely = new TimelyService(client, baseUrl);// get events
JsonNode eventList = timely.events()
.list("2014-08-18", "2014-08-24")
.get(timeout);// get first project's name (reactivly)
Promise projectName = timely.projects()
.list(10, 0, "ASC")
.map(json -> ((ArrayNode) json).get(0).path("name").asText());
```