Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Nylas Java SDK Changelog

### Unreleased
* Added support for Notetaker APIs
* Added support for Notetaker via the calendar and event APIs

### [2.7.0] - Release 2025-03-03
* Added support for listing import events via `events.listImportEvents()`
* Added sandbox to the Environment Enum
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/com/nylas/models/Calendar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ data class Calendar(
*/
@Json(name = "metadata")
val metadata: Map<String, String>? = null,
/**
* Notetaker meeting bot settings for this calendar.
*/
@Json(name = "notetaker")
val notetaker: CalendarNotetaker? = null,
) {
/**
* Get the type of object.
Expand Down
103 changes: 103 additions & 0 deletions src/main/kotlin/com/nylas/models/CalendarNotetaker.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representation of Notetaker meeting bot settings for a calendar.
*/
data class CalendarNotetaker(
/**
* The display name for the Notetaker bot.
*/
@Json(name = "name")
val name: String? = "Nylas Notetaker",

/**
* Notetaker Meeting Settings
*/
@Json(name = "meeting_settings")
val meetingSettings: MeetingSettings? = null,

/**
* Rules for when the Notetaker should join a meeting.
*/
@Json(name = "rules")
val rules: Rules? = null,
) {
/**
* Data class for Notetaker Meeting Settings
*/
data class MeetingSettings(
/**
* When true, Notetaker records the meeting's video.
*/
@Json(name = "video_recording")
val videoRecording: Boolean? = true,

/**
* When true, Notetaker records the meeting's audio.
*/
@Json(name = "audio_recording")
val audioRecording: Boolean? = true,

/**
* When true, Notetaker transcribes the meeting's audio.
*/
@Json(name = "transcription")
val transcription: Boolean? = true,
)

/**
* Data class for Notetaker event selection rules
*/
data class Rules(
/**
* Types of events to include for notetaking.
*/
@Json(name = "event_selection")
val eventSelection: List<EventSelectionType>? = null,

/**
* Filters to apply based on the number of participants.
*/
@Json(name = "participant_filter")
val participantFilter: ParticipantFilter? = null,
)

/**
* Event selection types for Notetaker.
*/
enum class EventSelectionType {
@Json(name = "internal")
INTERNAL,

@Json(name = "external")
EXTERNAL,

@Json(name = "own_events")
OWN_EVENTS,

@Json(name = "participant_only")
PARTICIPANT_ONLY,

@Json(name = "all")
ALL,
}

/**
* Participant filters for Notetaker.
*/
data class ParticipantFilter(
/**
* Only have meeting bot join meetings with greater than or equal to this number of participants.
*/
@Json(name = "participants_gte")
val participantsGte: Int? = null,

/**
* Only have meeting bot join meetings with less than or equal to this number of participants.
*/
@Json(name = "participants_lte")
val participantsLte: Int? = null,
)
}
15 changes: 14 additions & 1 deletion src/main/kotlin/com/nylas/models/CreateCalendarRequest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ data class CreateCalendarRequest(
*/
@Json(name = "metadata")
val metadata: Map<String, String>? = null,
/**
* Notetaker meeting bot settings for this calendar.
*/
@Json(name = "notetaker")
val notetaker: CalendarNotetaker? = null,
) {
/**
* A builder for creating a [CreateCalendarRequest].
Expand All @@ -45,6 +50,7 @@ data class CreateCalendarRequest(
private var location: String? = null
private var timezone: String? = null
private var metadata: Map<String, String>? = null
private var notetaker: CalendarNotetaker? = null

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

/**
* Set Notetaker meeting bot settings for this calendar.
* @param notetaker Notetaker meeting bot settings.
* @return The builder.
*/
fun notetaker(notetaker: CalendarNotetaker) = apply { this.notetaker = notetaker }

/**
* Build the [CreateCalendarRequest].
* @return A [CreateCalendarRequest] with the provided values.
*/
fun build() = CreateCalendarRequest(name, description, location, timezone, metadata)
fun build() = CreateCalendarRequest(name, description, location, timezone, metadata, notetaker)
}
}
14 changes: 14 additions & 0 deletions src/main/kotlin/com/nylas/models/CreateEventRequest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ data class CreateEventRequest(
*/
@Json(name = "hide_participant")
val hideParticipant: Boolean? = null,
/**
* Notetaker meeting bot settings for this event.
*/
@Json(name = "notetaker")
val notetaker: EventNotetaker? = null,
) {
/**
* This sealed class represents the different types of event time configurations.
Expand Down Expand Up @@ -431,6 +436,7 @@ data class CreateEventRequest(
private var visibility: EventVisibility? = null
private var capacity: Int? = null
private var hideParticipant: Boolean? = null
private var notetaker: EventNotetaker? = null

/**
* Set the event title.
Expand Down Expand Up @@ -538,6 +544,13 @@ data class CreateEventRequest(
*/
fun hideParticipant(hideParticipant: Boolean) = apply { this.hideParticipant = hideParticipant }

/**
* Set the notetaker meeting bot settings for the event.
* @param notetaker The notetaker meeting bot settings for the event.
* @return The builder.
*/
fun notetaker(notetaker: EventNotetaker) = apply { this.notetaker = notetaker }

/**
* Builds the [CreateEventRequest] object.
* @return [CreateEventRequest] object.
Expand All @@ -559,6 +572,7 @@ data class CreateEventRequest(
visibility,
capacity,
hideParticipant,
notetaker,
)
}
}
138 changes: 138 additions & 0 deletions src/main/kotlin/com/nylas/models/CreateNotetakerRequest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
package com.nylas.models

import com.squareup.moshi.Json

/**
* Class representation of the Nylas Notetaker creation request.
*/
data class CreateNotetakerRequest(
/**
* A meeting invitation link that Notetaker uses to join the meeting.
*/
@Json(name = "meeting_link")
val meetingLink: String,

/**
* When Notetaker should join the meeting, in Unix timestamp format.
*/
@Json(name = "join_time")
val joinTime: Long? = null,

/**
* The display name for the Notetaker bot.
*/
@Json(name = "name")
val name: String? = "Nylas Notetaker",

/**
* Notetaker Meeting Settings
*/
@Json(name = "meeting_settings")
val meetingSettings: MeetingSettings? = null,
) {
/**
* Data class for Notetaker Meeting Settings
*/
data class MeetingSettings(
/**
* When true, Notetaker records the meeting's video.
*/
@Json(name = "video_recording")
val videoRecording: Boolean? = true,

/**
* When true, Notetaker records the meeting's audio.
*/
@Json(name = "audio_recording")
val audioRecording: Boolean? = true,

/**
* When true, Notetaker transcribes the meeting's audio.
*/
@Json(name = "transcription")
val transcription: Boolean? = true,
) {
/**
* Builder for [MeetingSettings].
*/
class Builder {
private var videoRecording: Boolean? = true
private var audioRecording: Boolean? = true
private var transcription: Boolean? = true

/**
* Set video recording setting.
* @param videoRecording Whether to record video.
* @return The builder.
*/
fun videoRecording(videoRecording: Boolean) = apply { this.videoRecording = videoRecording }

/**
* Set audio recording setting.
* @param audioRecording Whether to record audio.
* @return The builder.
*/
fun audioRecording(audioRecording: Boolean) = apply { this.audioRecording = audioRecording }

/**
* Set transcription setting.
* @param transcription Whether to transcribe audio.
* @return The builder.
*/
fun transcription(transcription: Boolean) = apply { this.transcription = transcription }

/**
* Build the [MeetingSettings].
* @return The [MeetingSettings].
*/
fun build() = MeetingSettings(
videoRecording = videoRecording,
audioRecording = audioRecording,
transcription = transcription,
)
}
}

/**
* Builder for [CreateNotetakerRequest].
*/
class Builder(
private val meetingLink: String,
) {
private var joinTime: Long? = null
private var name: String? = "Nylas Notetaker"
private var meetingSettings: MeetingSettings? = null

/**
* Set join time.
* @param joinTime When Notetaker should join the meeting.
* @return The builder.
*/
fun joinTime(joinTime: Long) = apply { this.joinTime = joinTime }

/**
* Set display name.
* @param name The display name for the Notetaker bot.
* @return The builder.
*/
fun name(name: String) = apply { this.name = name }

/**
* Set meeting settings.
* @param meetingSettings The meeting settings.
* @return The builder.
*/
fun meetingSettings(meetingSettings: MeetingSettings) = apply { this.meetingSettings = meetingSettings }

/**
* Build the [CreateNotetakerRequest].
* @return The [CreateNotetakerRequest].
*/
fun build() = CreateNotetakerRequest(
meetingLink = meetingLink,
joinTime = joinTime,
name = name,
meetingSettings = meetingSettings,
)
}
}
5 changes: 5 additions & 0 deletions src/main/kotlin/com/nylas/models/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ data class Event(
*/
@Json(name = "updated_at")
val updatedAt: Long? = null,
/**
* Notetaker meeting bot settings for this event.
*/
@Json(name = "notetaker")
val notetaker: EventNotetaker? = null,
) {
/**
* Get the type of object.
Expand Down
Loading
Loading