v1.21.0
This release of the Nylas Java SDK comes with new features and a fix.
Release Notes
Added
- Added missing
content_dispositionfield inFile(#149) - Added toJSON() and toMap() support to account owned models (#150)
- Added scheduler support for the EU region (#151)
Fixed
- Fixed NullPointerException sporadically occurring when calling
Message.toString()(#149)
Usage
toJSON() and toMap()
public class NylasExample {
public static void main(String[] args) throws Exception {
NylasClient client = new NylasClient();
NylasApplication application = client.application("CLIENT_ID", "CLIENT_SECRET");
Event event = application.events().get("EVENT_ID");
// Convert Event to JSON
String eventJSON = event.toJSON();
// Convert Event to Map
Map<String, Event> eventMap = event.toMap();
}
}EU Scheduler
public class NylasExample {
public static void main(String[] args) throws Exception {
// Setup Nylas client, defaulting to US region
NylasClient client = new NylasClient();
NylasApplication application = client.account("ACESS_TOKEN");
Schedulers usScheduler = application.schedulers(); // Scheduler URL pointing to https://api.schedule.nylas.com/
// Setup Nylas client for the EU region
NylasClient euClient = new NylasClient.Builder()
.baseUrl(NylasClient.EU_BASE_URL)
.build();
NylasApplication euApplication = euClient.account("ACESS_TOKEN");
Schedulers euScheduler = euApplication.schedulers(); // Scheduler URL pointing to https://ireland.api.schedule.nylas.com/
}
}