Releases: nylas/nylas-java
v2.2.0
Changelog
Added
- Added support for
roundTofield in availability response (#215) - Added support for
attributesfield in folder model (#215) - Added support for icloud as an auth provider (#215)
Changed
- Fixed builder for FindAttachmentQueryParams (#208)
- Fixed scopes to be optional for IMAP grants (#210)
- Fixed typo in updating grant schema (#211)
- Fixed endpoint for rotating webhook secrets (#212)
- Fixed response type for returning webhook IP addresses (#213)
Removed
- Removed unnecessary
clientIdfrom detectProvider params (#215)
v2.1.0
v2.0.0
The Nylas SDK for Kotlin & Java v2.0.0 is out of beta now Generally Available! This SDK sees a number of changes, including breaking changes, and more importantly brings full support of the new Nylas API v3 as well as full Kotlin support.
Changelog
Breaking changes
- Renamed artifact from
nylas-java-sdktonylas. - Nylas SDK v2 supports the Nylas API v3 exclusively, dropping support for any endpoints that are not available in v3. See API v3 Features and Changes for more information.
- Removed all REST calls from models and moved them directly into resources.
Added
- Full Kotlin support.
- Created models for all API resources and endpoints, for all HTTP methods to reduce confusion on which fields are available for each endpoint.
- Created error classes for the different API errors as well as SDK-specific errors.
Updated
- Now using Moshi annotations for JSON serialization/deserialization as opposed to manually writing JSON maps.
- Removed all REST calls from models and moved them directly into resources.
Removed
- Non-builder ways for initializing
NylasClient. - Local Webhook development support is removed due to incompatibility with the new API version.
Docs and References
Please refer to the README.md for a quick description and getting started guide with the new SDK. Furthermore, we have an UPGRADE.md for instructions on upgrading from v1.x to v2.x, as well as a reference guide for the Kotlin & Java SDK.
v1.22.0
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/
}
}v1.20.1
This release of the Nylas Java SDK comes with a few changes/fixes regarding the local webhook implementation.
Changed
- Provide default implementations for
WebhookHandlermethodsonOpen,onClose, andonError(#147)
Fixed
v1.20.0
This release of the Nylas Java SDK includes a couple of changes, most notably the release of local webhook development support built directly into the SDK. When implementing this feature in your app, the SDK will create a tunnel connection to a websocket server and registers it as a webhook callback to your Nylas account. See below for a usage example.
Release Notes
Added
- Added local webhook testing support (#145)
- Added new enums for
Webhook.TriggersandWebhook.State(#145)
Usage
Webhook Tunnel
During the setup process you can pass in a class that implements WebhookTunnel.WebhookHandler with methods to override the websocket client's callback methods. The most important method is the onMessage method which returns a parsed delta event from the webhook server.
public class NylasWebhook {
public static void main(String[] args) throws Exception {
ExampleConf conf = new ExampleConf();
NylasClient client = new NylasClient();
NylasApplication application = client.application("CLIENT_ID", "CLIENT_SECRET");
Tunnel webhookTunnel = new Tunnel.Builder(application, new HandleNotifications()).build();
webhookTunnel.connect();
}
}
class HandleNotifications implements Tunnel.WebhookHandler {
private static final Logger log = LogManager.getLogger(HandleNotifications.class);
@Override
public void onOpen(short httpStatusCode) {
log.info("OnOpen");
}
@Override
public void onClose(int code, String reason, boolean remote) {
log.info("onClose");
}
@Override
public void onMessage(Notification notification) {
log.info("onMessage");
}
@Override
public void onError(Exception ex) {
log.info("onError");
}
}