Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Nylas Java SDK Changelog

## [Unreleased]

### Changed
* Upgraded OkHttp dependency from 3.14.5 to 4.12.0

## [2.11.1] - Release 2025-07-11

### Added
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ dependencies {
// ////////////////////////////////
// Public dependencies

// OkHttp 3 - Http client (without Kotlin dependency of version 4)
api("com.squareup.okhttp3:okhttp:3.14.5")
// OkHttp 4 - Http client
api("com.squareup.okhttp3:okhttp:4.12.0")

// Moshi JSON library
implementation("com.squareup.moshi:moshi:1.15.0")
Expand Down
5 changes: 4 additions & 1 deletion examples/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ NYLAS_API_URI=https://api.us.nylas.com

# Grant ID - Required for message and event examples
# You can get this from your Nylas Dashboard after connecting an account
NYLAS_GRANT_ID=your_grant_id_here
NYLAS_GRANT_ID=your_grant_id_here

# Test email
NYLAS_TEST_EMAIL=your@email.com
7 changes: 7 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ help:
@echo " java-notetaker - Run the Java Notetaker example"
@echo " java-events - Run the Java Events example"
@echo " java-folders - Run the Java Folders example"
@echo " java-large-attachments - Run the Java Large Attachments example"
@echo " kotlin-notetaker - Run the Kotlin Notetaker example"
@echo " kotlin-folders - Run the Kotlin Folders example"

Expand All @@ -21,6 +22,12 @@ list:
java-notetaker:
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.NotetakerExample

java-messages:
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.MessagesExample

java-large-attachments:
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.LargeAttachmentsExample

java-events:
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.EventsExample

Expand Down
29 changes: 25 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ The `FoldersExample` and `KotlinFoldersExample` demonstrate how to use the Nylas
- Demonstrate the builder pattern with various query parameters
- Show folder details including parent relationships and unread counts

### Large Attachments Example

The `LargeAttachmentsExample` demonstrates how to send emails with large file attachments using the Nylas Java SDK:

- Create and send emails with 3MB and 10MB test files
- Demonstrate the SDK's automatic handling of large attachments (switches to multipart form data for files ≥ 3MB)
- Send multiple large attachments in a single email
- Compare small vs large attachment handling mechanisms
- Use the `FileUtils.attachFileRequestBuilder()` helper method for easy file attachment
- Automatic cleanup of temporary test files

## Setup

### 1. Environment Setup
Expand All @@ -58,6 +69,9 @@ NYLAS_API_KEY=your_api_key_here
# Your grant ID (required for message examples)
NYLAS_GRANT_ID=your_grant_id_here

# Test email address (required for large attachments example)
NYLAS_TEST_EMAIL=test@example.com

# Add your meeting link (Zoom, Google Meet, or Microsoft Teams) - for Notetaker example
MEETING_LINK=your_meeting_link_here
```
Expand Down Expand Up @@ -101,6 +115,11 @@ Run Kotlin Folders example:
./gradlew :examples:run -PmainClass=com.nylas.examples.KotlinFoldersExampleKt
```

Run Java Large Attachments example:
```bash
./gradlew :examples:run -PmainClass=com.nylas.examples.LargeAttachmentsExample
```

#### Option 2: Using the Makefile

List available examples:
Expand All @@ -127,6 +146,7 @@ make kotlin-way
- `KotlinMessagesExample.kt` (Kotlin - demonstrates new message features)
- `EventsExample.java` (Java - demonstrates events)
- `FoldersExample.java` (Java - demonstrates folders and single_level parameter)
- `LargeAttachmentsExample.java` (Java - demonstrates large file attachments)
- `NotetakerExample.java` (Java - demonstrates notetakers)
- `KotlinNotetakerExample.kt` (Kotlin - demonstrates notetakers)
- `KotlinFoldersExample.kt` (Kotlin - demonstrates folders and single_level parameter)
Expand All @@ -143,10 +163,11 @@ examples/
└── main/
├── java/ # Java examples
│ └── com/nylas/examples/
│ ├── MessagesExample.java # NEW: Message features demo
│ ├── EventsExample.java # Events API demo
│ ├── FoldersExample.java # NEW: Folders API demo with single_level parameter
│ └── NotetakerExample.java # Notetaker API demo
│ ├── MessagesExample.java # NEW: Message features demo
│ ├── EventsExample.java # Events API demo
│ ├── FoldersExample.java # NEW: Folders API demo with single_level parameter
│ ├── LargeAttachmentsExample.java # NEW: Large file attachments demo
│ └── NotetakerExample.java # Notetaker API demo
└── kotlin/ # Kotlin examples
└── com/nylas/examples/
├── KotlinMessagesExample.kt # NEW: Message features demo
Expand Down
1 change: 1 addition & 0 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ tasks.register("listExamples") {
println("- Java-Events: com.nylas.examples.EventsExample")
println("- Java-Messages: com.nylas.examples.MessagesExample")
println("- Java-Folders: com.nylas.examples.FoldersExample")
println("- Java-Large-Attachments: com.nylas.examples.LargeAttachmentsExample")
println("- Kotlin-Notetaker: com.nylas.examples.KotlinNotetakerExampleKt")
println("- Kotlin-Messages: com.nylas.examples.KotlinMessagesExampleKt")
println("- Kotlin-Folders: com.nylas.examples.KotlinFoldersExampleKt")
Expand Down
Loading
Loading