Skip to content

Commit 18a9e9f

Browse files
authored
TT-4349: Java SDK for events & rsvp (#317)
1 parent 8b69f75 commit 18a9e9f

14 files changed

Lines changed: 550 additions & 39 deletions

‎.claude/settings.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"matcher": "Bash",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "cmd=$(jq -r '.tool_input.command // \"\"'); if echo \"$cmd\" | grep -q 'gh pr create'; then git diff main...HEAD --name-only | grep -q 'CHANGELOG.md' || echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"CHANGELOG.md has not been updated on this branch.\",\"additionalContext\":\"STOP: Do not open the PR yet. CHANGELOG.md has not been modified on this branch. Per .claude/instructions.md, open CHANGELOG.md and add an entry under the ## [Unreleased] section describing the changes in this PR, then retry gh pr create.\"}}'; fi"
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}

‎.claude/settings.local.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
"Bash(./gradlew:*)",
1515
"Bash(./gradlew build:*)",
1616
"Bash(gh pr *)",
17-
"Bash(gh issue *)"
17+
"Bash(gh issue *)",
18+
"Bash(python3 -c ' *)",
19+
"mcp__claude_ai_Atlassian__getJiraIssue",
20+
"mcp__claude_ai_Atlassian__getAccessibleAtlassianResources",
21+
"WebFetch(domain:developer.nylas.com)",
22+
"Bash(gh run *)"
1823
]
1924
}
2025
}

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
* `colorId` field on `Event`, `CreateEventRequest`, and `UpdateEventRequest` for Google Calendar event colors, mapped to the `color_id` JSON property.
77
Valid values are strings `"1"` through `"11"`.
88
See [Google Calendar Colors](https://developers.google.com/calendar/api/v3/reference/colors).
9+
* `resources` field (`List<EventResource>`) on `Event`, `CreateEventRequest`, and `UpdateEventRequest` for associating rooms or resources with events
10+
* `textDescription` field on `Event` for the plain-text description of an event (`text_description`)
11+
* `EventResource` model with `email` (required) and `name` (optional) fields
12+
* `select` and `tentativeAsBusy` query parameters on `ListEventQueryParams`, `FindEventQueryParams`, `CreateEventQueryParams`, and `UpdateEventQueryParams`
13+
* `skipNylasEmail` query parameter on `SendRsvpQueryParams` to suppress Nylas notification emails when sending an RSVP
14+
* `eventType` on `ListEventQueryParams` now accepts `List<EventType>` (was `EventType`) to allow filtering by multiple event types simultaneously
15+
* Extended `EventNotetaker.MeetingSettings` and `EventNotetakerRequest.MeetingSettings` with new fields:
16+
- `actionItems` / `actionItemsSettings` (`ActionItemsSettings`) for AI-generated action items with optional custom instructions
17+
- `summary` / `summarySettings` (`SummarySettings`) for AI-generated meeting summaries with optional custom instructions
18+
- `leaveAfterSilenceSeconds` for configuring inactivity timeout
19+
- `transcriptionSettings` (`TranscriptionSettings`) with `expectedLanguages` and `fallbackLanguage`
920
* `metadataPair` field on `ListMessagesQueryParams` (and its `Builder`) for filtering messages by metadata key-value pairs via the `metadata_pair` query parameter. (#319)
1021

1122
### Fixed

‎src/main/kotlin/com/nylas/models/CreateEventQueryParams.kt‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ data class CreateEventQueryParams(
1616
*/
1717
@Json(name = "notify_participants")
1818
val notifyParticipants: Boolean? = null,
19+
/**
20+
* Comma-separated list of fields to return in the response.
21+
*/
22+
@Json(name = "select")
23+
val select: String? = null,
24+
/**
25+
* When true, tentative events are counted as busy.
26+
*/
27+
@Json(name = "tentative_as_busy")
28+
val tentativeAsBusy: Boolean? = null,
1929
) : IQueryParams {
2030
/**
2131
* Builder for [CreateEventQueryParams].
@@ -25,6 +35,8 @@ data class CreateEventQueryParams(
2535
private val calendarId: String,
2636
) {
2737
private var notifyParticipants: Boolean? = null
38+
private var select: String? = null
39+
private var tentativeAsBusy: Boolean? = null
2840

2941
/**
3042
* Sets whether notifications containing the calendar event is sent to all event participants.
@@ -33,13 +45,29 @@ data class CreateEventQueryParams(
3345
*/
3446
fun notifyParticipants(notifyParticipants: Boolean?) = apply { this.notifyParticipants = notifyParticipants }
3547

48+
/**
49+
* Sets the comma-separated list of fields to return in the response.
50+
* @param select The fields to return.
51+
* @return The builder.
52+
*/
53+
fun select(select: String?) = apply { this.select = select }
54+
55+
/**
56+
* Sets whether tentative events are counted as busy.
57+
* @param tentativeAsBusy Whether tentative events are counted as busy.
58+
* @return The builder.
59+
*/
60+
fun tentativeAsBusy(tentativeAsBusy: Boolean?) = apply { this.tentativeAsBusy = tentativeAsBusy }
61+
3662
/**
3763
* Builds a [CreateEventQueryParams] instance.
3864
* @return The [CreateEventQueryParams] instance.
3965
*/
4066
fun build() = CreateEventQueryParams(
4167
calendarId,
4268
notifyParticipants,
69+
select,
70+
tentativeAsBusy,
4371
)
4472
}
4573
}

‎src/main/kotlin/com/nylas/models/CreateEventRequest.kt‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ data class CreateEventRequest(
101101
*/
102102
@Json(name = "color_id")
103103
val colorId: String? = null,
104+
/**
105+
* List of resources (e.g. rooms) to associate with the event.
106+
*/
107+
@Json(name = "resources")
108+
val resources: List<EventResource>? = null,
104109
) {
105110
/**
106111
* This sealed class represents the different types of event time configurations.
@@ -519,6 +524,7 @@ data class CreateEventRequest(
519524
private var hideParticipant: Boolean? = null
520525
private var notetaker: EventNotetakerRequest? = null
521526
private var colorId: String? = null
527+
private var resources: List<EventResource>? = null
522528

523529
/**
524530
* Set the event title.
@@ -642,6 +648,13 @@ data class CreateEventRequest(
642648
*/
643649
fun colorId(colorId: String) = apply { this.colorId = colorId }
644650

651+
/**
652+
* Set the list of resources (e.g. rooms) to associate with the event.
653+
* @param resources The list of resources.
654+
* @return The builder.
655+
*/
656+
fun resources(resources: List<EventResource>) = apply { this.resources = resources }
657+
645658
/**
646659
* Builds the [CreateEventRequest] object.
647660
* @return [CreateEventRequest] object.
@@ -665,6 +678,7 @@ data class CreateEventRequest(
665678
hideParticipant,
666679
notetaker,
667680
colorId,
681+
resources,
668682
)
669683
}
670684
}

‎src/main/kotlin/com/nylas/models/Event.kt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ data class Event(
162162
*/
163163
@Json(name = "color_id")
164164
val colorId: String? = null,
165+
/**
166+
* List of resources (e.g. rooms) associated with the event.
167+
*/
168+
@Json(name = "resources")
169+
val resources: List<EventResource>? = null,
170+
/**
171+
* Plain-text description of the event, if available.
172+
*/
173+
@Json(name = "text_description")
174+
val textDescription: String? = null,
165175
) {
166176
/**
167177
* Get the type of object.

‎src/main/kotlin/com/nylas/models/EventNotetaker.kt‎

Lines changed: 108 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,60 @@ data class EventNotetaker(
4646
*/
4747
@Json(name = "transcription")
4848
val transcription: Boolean? = true,
49-
)
49+
50+
/**
51+
* When true, Notetaker generates action items from the meeting.
52+
*/
53+
@Json(name = "action_items")
54+
val actionItems: Boolean? = null,
55+
56+
/**
57+
* Settings for action item generation.
58+
*/
59+
@Json(name = "action_items_settings")
60+
val actionItemsSettings: ActionItemsSettings? = null,
61+
62+
/**
63+
* When true, Notetaker generates a summary of the meeting.
64+
*/
65+
@Json(name = "summary")
66+
val summary: Boolean? = null,
67+
68+
/**
69+
* Settings for summary generation.
70+
*/
71+
@Json(name = "summary_settings")
72+
val summarySettings: SummarySettings? = null,
73+
74+
/**
75+
* Number of seconds of silence after which Notetaker leaves the meeting.
76+
*/
77+
@Json(name = "leave_after_silence_seconds")
78+
val leaveAfterSilenceSeconds: Int? = null,
79+
80+
/**
81+
* Settings for transcription.
82+
*/
83+
@Json(name = "transcription_settings")
84+
val transcriptionSettings: TranscriptionSettings? = null,
85+
) {
86+
data class ActionItemsSettings(
87+
@Json(name = "custom_instructions")
88+
val customInstructions: String? = null,
89+
)
90+
91+
data class SummarySettings(
92+
@Json(name = "custom_instructions")
93+
val customInstructions: String? = null,
94+
)
95+
96+
data class TranscriptionSettings(
97+
@Json(name = "expected_languages")
98+
val expectedLanguages: List<String>? = null,
99+
@Json(name = "fallback_language")
100+
val fallbackLanguage: String? = null,
101+
)
102+
}
50103
}
51104

52105
/**
@@ -87,5 +140,58 @@ data class EventNotetakerRequest(
87140
*/
88141
@Json(name = "transcription")
89142
val transcription: Boolean? = true,
90-
)
143+
144+
/**
145+
* When true, Notetaker generates action items from the meeting.
146+
*/
147+
@Json(name = "action_items")
148+
val actionItems: Boolean? = null,
149+
150+
/**
151+
* Settings for action item generation.
152+
*/
153+
@Json(name = "action_items_settings")
154+
val actionItemsSettings: ActionItemsSettings? = null,
155+
156+
/**
157+
* When true, Notetaker generates a summary of the meeting.
158+
*/
159+
@Json(name = "summary")
160+
val summary: Boolean? = null,
161+
162+
/**
163+
* Settings for summary generation.
164+
*/
165+
@Json(name = "summary_settings")
166+
val summarySettings: SummarySettings? = null,
167+
168+
/**
169+
* Number of seconds of silence after which Notetaker leaves the meeting.
170+
*/
171+
@Json(name = "leave_after_silence_seconds")
172+
val leaveAfterSilenceSeconds: Int? = null,
173+
174+
/**
175+
* Settings for transcription.
176+
*/
177+
@Json(name = "transcription_settings")
178+
val transcriptionSettings: TranscriptionSettings? = null,
179+
) {
180+
data class ActionItemsSettings(
181+
@Json(name = "custom_instructions")
182+
val customInstructions: String? = null,
183+
)
184+
185+
data class SummarySettings(
186+
@Json(name = "custom_instructions")
187+
val customInstructions: String? = null,
188+
)
189+
190+
data class TranscriptionSettings(
191+
@Json(name = "expected_languages")
192+
val expectedLanguages: List<String>? = null,
193+
@Json(name = "fallback_language")
194+
val fallbackLanguage: String? = null,
195+
)
196+
}
91197
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.nylas.models
2+
3+
import com.squareup.moshi.Json
4+
import com.squareup.moshi.JsonClass
5+
6+
@JsonClass(generateAdapter = true)
7+
data class EventResource(
8+
@Json(name = "email")
9+
val email: String,
10+
@Json(name = "name")
11+
val name: String? = null,
12+
)

‎src/main/kotlin/com/nylas/models/FindEventQueryParams.kt‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ data class FindEventQueryParams(
1111
*/
1212
@Json(name = "calendar_id")
1313
val calendarId: String,
14+
/**
15+
* Comma-separated list of fields to return in the response.
16+
*/
17+
@Json(name = "select")
18+
val select: String? = null,
19+
/**
20+
* When true, tentative events are counted as busy.
21+
*/
22+
@Json(name = "tentative_as_busy")
23+
val tentativeAsBusy: Boolean? = null,
1424
) : IQueryParams {
1525
/**
1626
* Builder for [FindEventQueryParams].
@@ -19,12 +29,31 @@ data class FindEventQueryParams(
1929
data class Builder(
2030
private val calendarId: String,
2131
) {
32+
private var select: String? = null
33+
private var tentativeAsBusy: Boolean? = null
34+
35+
/**
36+
* Sets the comma-separated list of fields to return in the response.
37+
* @param select The fields to return.
38+
* @return The builder.
39+
*/
40+
fun select(select: String?) = apply { this.select = select }
41+
42+
/**
43+
* Sets whether tentative events are counted as busy.
44+
* @param tentativeAsBusy Whether tentative events are counted as busy.
45+
* @return The builder.
46+
*/
47+
fun tentativeAsBusy(tentativeAsBusy: Boolean?) = apply { this.tentativeAsBusy = tentativeAsBusy }
48+
2249
/**
2350
* Builds a new [FindEventQueryParams] instance.
2451
* @return [FindEventQueryParams]
2552
*/
2653
fun build() = FindEventQueryParams(
2754
calendarId,
55+
select,
56+
tentativeAsBusy,
2857
)
2958
}
3059
}

0 commit comments

Comments
 (0)