Skip to content

Commit a27d60b

Browse files
committed
feat: Added support for Notetaker via the calendar and event APIs
1 parent a2b8193 commit a27d60b

File tree

13 files changed

+425
-3
lines changed

13 files changed

+425
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### Unreleased
44
* Added support for Notetaker APIs
5+
* Added support for notetaker via the calendar and event APIs
56

67
### [2.7.0] - Release 2025-03-03
78
* Added support for listing import events via `events.listImportEvents()`

src/main/kotlin/com/nylas/models/Calendar.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ data class Calendar(
7474
*/
7575
@Json(name = "metadata")
7676
val metadata: Map<String, String>? = null,
77+
/**
78+
* Notetaker meeting bot settings for this calendar.
79+
*/
80+
@Json(name = "notetaker")
81+
val notetaker: CalendarNotetaker? = null,
7782
) {
7883
/**
7984
* Get the type of object.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package com.nylas.models
2+
3+
import com.squareup.moshi.Json
4+
5+
/**
6+
* Class representation of Notetaker meeting bot settings for a calendar.
7+
*/
8+
data class CalendarNotetaker(
9+
/**
10+
* The display name for the Notetaker bot.
11+
*/
12+
@Json(name = "name")
13+
val name: String? = "Nylas Notetaker",
14+
15+
/**
16+
* Notetaker Meeting Settings
17+
*/
18+
@Json(name = "meeting_settings")
19+
val meetingSettings: MeetingSettings? = null,
20+
21+
/**
22+
* Rules for when the Notetaker should join a meeting.
23+
*/
24+
@Json(name = "rules")
25+
val rules: Rules? = null,
26+
) {
27+
/**
28+
* Data class for Notetaker Meeting Settings
29+
*/
30+
data class MeetingSettings(
31+
/**
32+
* When true, Notetaker records the meeting's video.
33+
*/
34+
@Json(name = "video_recording")
35+
val videoRecording: Boolean? = true,
36+
37+
/**
38+
* When true, Notetaker records the meeting's audio.
39+
*/
40+
@Json(name = "audio_recording")
41+
val audioRecording: Boolean? = true,
42+
43+
/**
44+
* When true, Notetaker transcribes the meeting's audio.
45+
*/
46+
@Json(name = "transcription")
47+
val transcription: Boolean? = true,
48+
)
49+
50+
/**
51+
* Data class for Notetaker event selection rules
52+
*/
53+
data class Rules(
54+
/**
55+
* Types of events to include for notetaking.
56+
*/
57+
@Json(name = "event_selection")
58+
val eventSelection: List<EventSelectionType>? = null,
59+
60+
/**
61+
* Filters to apply based on the number of participants.
62+
*/
63+
@Json(name = "participant_filter")
64+
val participantFilter: ParticipantFilter? = null,
65+
)
66+
67+
/**
68+
* Event selection types for Notetaker.
69+
*/
70+
enum class EventSelectionType {
71+
@Json(name = "internal")
72+
INTERNAL,
73+
74+
@Json(name = "external")
75+
EXTERNAL,
76+
77+
@Json(name = "own_events")
78+
OWN_EVENTS,
79+
80+
@Json(name = "participant_only")
81+
PARTICIPANT_ONLY,
82+
83+
@Json(name = "all")
84+
ALL,
85+
}
86+
87+
/**
88+
* Participant filters for Notetaker.
89+
*/
90+
data class ParticipantFilter(
91+
/**
92+
* Only have meeting bot join meetings with greater than or equal to this number of participants.
93+
*/
94+
@Json(name = "participants_gte")
95+
val participantsGte: Int? = null,
96+
97+
/**
98+
* Only have meeting bot join meetings with less than or equal to this number of participants.
99+
*/
100+
@Json(name = "participants_lte")
101+
val participantsLte: Int? = null,
102+
)
103+
}

src/main/kotlin/com/nylas/models/CreateCalendarRequest.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ data class CreateCalendarRequest(
3232
*/
3333
@Json(name = "metadata")
3434
val metadata: Map<String, String>? = null,
35+
/**
36+
* Notetaker meeting bot settings for this calendar.
37+
*/
38+
@Json(name = "notetaker")
39+
val notetaker: CalendarNotetaker? = null,
3540
) {
3641
/**
3742
* A builder for creating a [CreateCalendarRequest].
@@ -45,6 +50,7 @@ data class CreateCalendarRequest(
4550
private var location: String? = null
4651
private var timezone: String? = null
4752
private var metadata: Map<String, String>? = null
53+
private var notetaker: CalendarNotetaker? = null
4854

4955
/**
5056
* Set the description of the calendar.
@@ -75,10 +81,17 @@ data class CreateCalendarRequest(
7581
*/
7682
fun metadata(metadata: Map<String, String>) = apply { this.metadata = metadata }
7783

84+
/**
85+
* Set Notetaker meeting bot settings for this calendar.
86+
* @param notetaker Notetaker meeting bot settings.
87+
* @return The builder.
88+
*/
89+
fun notetaker(notetaker: CalendarNotetaker) = apply { this.notetaker = notetaker }
90+
7891
/**
7992
* Build the [CreateCalendarRequest].
8093
* @return A [CreateCalendarRequest] with the provided values.
8194
*/
82-
fun build() = CreateCalendarRequest(name, description, location, timezone, metadata)
95+
fun build() = CreateCalendarRequest(name, description, location, timezone, metadata, notetaker)
8396
}
8497
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ data class CreateEventRequest(
8989
*/
9090
@Json(name = "hide_participant")
9191
val hideParticipant: Boolean? = null,
92+
/**
93+
* Notetaker meeting bot settings for this event.
94+
*/
95+
@Json(name = "notetaker")
96+
val notetaker: EventNotetaker? = null,
9297
) {
9398
/**
9499
* This sealed class represents the different types of event time configurations.
@@ -431,6 +436,7 @@ data class CreateEventRequest(
431436
private var visibility: EventVisibility? = null
432437
private var capacity: Int? = null
433438
private var hideParticipant: Boolean? = null
439+
private var notetaker: EventNotetaker? = null
434440

435441
/**
436442
* Set the event title.
@@ -538,6 +544,13 @@ data class CreateEventRequest(
538544
*/
539545
fun hideParticipant(hideParticipant: Boolean) = apply { this.hideParticipant = hideParticipant }
540546

547+
/**
548+
* Set the notetaker meeting bot settings for the event.
549+
* @param notetaker The notetaker meeting bot settings for the event.
550+
* @return The builder.
551+
*/
552+
fun notetaker(notetaker: EventNotetaker) = apply { this.notetaker = notetaker }
553+
541554
/**
542555
* Builds the [CreateEventRequest] object.
543556
* @return [CreateEventRequest] object.
@@ -559,6 +572,7 @@ data class CreateEventRequest(
559572
visibility,
560573
capacity,
561574
hideParticipant,
575+
notetaker,
562576
)
563577
}
564578
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ data class Event(
145145
*/
146146
@Json(name = "updated_at")
147147
val updatedAt: Long? = null,
148+
/**
149+
* Notetaker meeting bot settings for this event.
150+
*/
151+
@Json(name = "notetaker")
152+
val notetaker: EventNotetaker? = null,
148153
) {
149154
/**
150155
* Get the type of object.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.nylas.models
2+
3+
import com.squareup.moshi.Json
4+
5+
/**
6+
* Class representation of Notetaker meeting bot settings for an event.
7+
*/
8+
data class EventNotetaker(
9+
/**
10+
* The Notetaker bot ID.
11+
*/
12+
@Json(name = "id")
13+
val id: String? = null,
14+
15+
/**
16+
* The display name for the Notetaker bot.
17+
*/
18+
@Json(name = "name")
19+
val name: String? = "Nylas Notetaker",
20+
21+
/**
22+
* Notetaker Meeting Settings
23+
*/
24+
@Json(name = "meeting_settings")
25+
val meetingSettings: MeetingSettings? = null,
26+
) {
27+
/**
28+
* Data class for Notetaker Meeting Settings
29+
*/
30+
data class MeetingSettings(
31+
/**
32+
* When true, Notetaker records the meeting's video.
33+
*/
34+
@Json(name = "video_recording")
35+
val videoRecording: Boolean? = true,
36+
37+
/**
38+
* When true, Notetaker records the meeting's audio.
39+
*/
40+
@Json(name = "audio_recording")
41+
val audioRecording: Boolean? = true,
42+
43+
/**
44+
* When true, Notetaker transcribes the meeting's audio.
45+
*/
46+
@Json(name = "transcription")
47+
val transcription: Boolean? = true,
48+
)
49+
}

src/main/kotlin/com/nylas/models/UpdateCalendarRequest.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ data class UpdateCalendarRequest(
4444
*/
4545
@Json(name = "hex_foreground_color")
4646
val hexForegroundColor: String? = null,
47+
/**
48+
* Notetaker meeting bot settings for this calendar.
49+
*/
50+
@Json(name = "notetaker")
51+
val notetaker: CalendarNotetaker? = null,
4752
) {
4853
class Builder {
4954
private var name: String? = null
@@ -53,6 +58,7 @@ data class UpdateCalendarRequest(
5358
private var metadata: Map<String, String>? = null
5459
private var hexColor: String? = null
5560
private var hexForegroundColor: String? = null
61+
private var notetaker: CalendarNotetaker? = null
5662

5763
/**
5864
* Set the name of the Calendar.
@@ -99,9 +105,15 @@ data class UpdateCalendarRequest(
99105
*/
100106
fun hexForegroundColor(hexForegroundColor: String) = apply { this.hexForegroundColor = hexForegroundColor }
101107

108+
/**
109+
* Set Notetaker meeting bot settings for this calendar.
110+
* @param notetaker Notetaker meeting bot settings.
111+
*/
112+
fun notetaker(notetaker: CalendarNotetaker) = apply { this.notetaker = notetaker }
113+
102114
/**
103115
* Build the UpdateCalendarRequest object.
104116
*/
105-
fun build() = UpdateCalendarRequest(name, description, location, timezone, metadata, hexColor, hexForegroundColor)
117+
fun build() = UpdateCalendarRequest(name, description, location, timezone, metadata, hexColor, hexForegroundColor, notetaker)
106118
}
107119
}

src/main/kotlin/com/nylas/models/UpdateEventRequest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ data class UpdateEventRequest(
8989
*/
9090
@Json(name = "hide_participant")
9191
val hideParticipant: Boolean? = null,
92+
/**
93+
* Notetaker meeting bot settings for this event.
94+
*/
95+
@Json(name = "notetaker")
96+
val notetaker: EventNotetaker? = null,
9297
) {
9398
/**
9499
* This sealed class represents the different types of event time configurations.
@@ -514,6 +519,7 @@ data class UpdateEventRequest(
514519
private var visibility: EventVisibility? = null
515520
private var capacity: Int? = null
516521
private var hideParticipant: Boolean? = null
522+
private var notetaker: EventNotetaker? = null
517523

518524
/**
519525
* Set the when object.
@@ -629,6 +635,13 @@ data class UpdateEventRequest(
629635
*/
630636
fun hideParticipant(hideParticipant: Boolean) = apply { this.hideParticipant = hideParticipant }
631637

638+
/**
639+
* Update the notetaker meeting bot settings for the event.
640+
* @param notetaker Notetaker meeting bot settings for this event.
641+
* @return The builder.
642+
*/
643+
fun notetaker(notetaker: EventNotetaker) = apply { this.notetaker = notetaker }
644+
632645
/**
633646
* Builds the [UpdateEventRequest] object.
634647
* @return [UpdateEventRequest] object.
@@ -650,6 +663,7 @@ data class UpdateEventRequest(
650663
visibility,
651664
capacity,
652665
hideParticipant,
666+
notetaker,
653667
)
654668
}
655669
}

0 commit comments

Comments
 (0)