Skip to content

Commit a2b8193

Browse files
committed
feat: Added support for Notetaker APIs
1 parent 0a0a738 commit a2b8193

File tree

7 files changed

+1022
-0
lines changed

7 files changed

+1022
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Nylas Java SDK Changelog
22

3+
### Unreleased
4+
* Added support for Notetaker APIs
5+
36
### [2.7.0] - Release 2025-03-03
47
* Added support for listing import events via `events.listImportEvents()`
58
* Added sandbox to the Environment Enum
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
package com.nylas.models
2+
3+
import com.squareup.moshi.Json
4+
5+
/**
6+
* Class representation of the Nylas Notetaker creation request.
7+
*/
8+
data class CreateNotetakerRequest(
9+
/**
10+
* A meeting invitation link that Notetaker uses to join the meeting.
11+
*/
12+
@Json(name = "meeting_link")
13+
val meetingLink: String,
14+
15+
/**
16+
* When Notetaker should join the meeting, in Unix timestamp format.
17+
*/
18+
@Json(name = "join_time")
19+
val joinTime: Long? = null,
20+
21+
/**
22+
* The display name for the Notetaker bot.
23+
*/
24+
@Json(name = "name")
25+
val name: String? = "Nylas Notetaker",
26+
27+
/**
28+
* Notetaker Meeting Settings
29+
*/
30+
@Json(name = "meeting_settings")
31+
val meetingSettings: MeetingSettings? = null,
32+
) {
33+
/**
34+
* Data class for Notetaker Meeting Settings
35+
*/
36+
data class MeetingSettings(
37+
/**
38+
* When true, Notetaker records the meeting's video.
39+
*/
40+
@Json(name = "video_recording")
41+
val videoRecording: Boolean? = true,
42+
43+
/**
44+
* When true, Notetaker records the meeting's audio.
45+
*/
46+
@Json(name = "audio_recording")
47+
val audioRecording: Boolean? = true,
48+
49+
/**
50+
* When true, Notetaker transcribes the meeting's audio.
51+
*/
52+
@Json(name = "transcription")
53+
val transcription: Boolean? = true,
54+
) {
55+
/**
56+
* Builder for [MeetingSettings].
57+
*/
58+
class Builder {
59+
private var videoRecording: Boolean? = true
60+
private var audioRecording: Boolean? = true
61+
private var transcription: Boolean? = true
62+
63+
/**
64+
* Set video recording setting.
65+
* @param videoRecording Whether to record video.
66+
* @return The builder.
67+
*/
68+
fun videoRecording(videoRecording: Boolean) = apply { this.videoRecording = videoRecording }
69+
70+
/**
71+
* Set audio recording setting.
72+
* @param audioRecording Whether to record audio.
73+
* @return The builder.
74+
*/
75+
fun audioRecording(audioRecording: Boolean) = apply { this.audioRecording = audioRecording }
76+
77+
/**
78+
* Set transcription setting.
79+
* @param transcription Whether to transcribe audio.
80+
* @return The builder.
81+
*/
82+
fun transcription(transcription: Boolean) = apply { this.transcription = transcription }
83+
84+
/**
85+
* Build the [MeetingSettings].
86+
* @return The [MeetingSettings].
87+
*/
88+
fun build() = MeetingSettings(
89+
videoRecording = videoRecording,
90+
audioRecording = audioRecording,
91+
transcription = transcription,
92+
)
93+
}
94+
}
95+
96+
/**
97+
* Builder for [CreateNotetakerRequest].
98+
*/
99+
class Builder(
100+
private val meetingLink: String,
101+
) {
102+
private var joinTime: Long? = null
103+
private var name: String? = "Nylas Notetaker"
104+
private var meetingSettings: MeetingSettings? = null
105+
106+
/**
107+
* Set join time.
108+
* @param joinTime When Notetaker should join the meeting.
109+
* @return The builder.
110+
*/
111+
fun joinTime(joinTime: Long) = apply { this.joinTime = joinTime }
112+
113+
/**
114+
* Set display name.
115+
* @param name The display name for the Notetaker bot.
116+
* @return The builder.
117+
*/
118+
fun name(name: String) = apply { this.name = name }
119+
120+
/**
121+
* Set meeting settings.
122+
* @param meetingSettings The meeting settings.
123+
* @return The builder.
124+
*/
125+
fun meetingSettings(meetingSettings: MeetingSettings) = apply { this.meetingSettings = meetingSettings }
126+
127+
/**
128+
* Build the [CreateNotetakerRequest].
129+
* @return The [CreateNotetakerRequest].
130+
*/
131+
fun build() = CreateNotetakerRequest(
132+
meetingLink = meetingLink,
133+
joinTime = joinTime,
134+
name = name,
135+
meetingSettings = meetingSettings,
136+
)
137+
}
138+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
package com.nylas.models
2+
3+
import com.squareup.moshi.Json
4+
5+
/**
6+
* Class representing the query parameters for listing Notetakers.
7+
*/
8+
data class ListNotetakersQueryParams(
9+
/**
10+
* Filter for Notetaker bots with the specified meeting state.
11+
*/
12+
@Json(name = "state")
13+
val state: Notetaker.NotetakerState? = null,
14+
15+
/**
16+
* Filter for Notetaker bots that are scheduled to join meetings after the specified time.
17+
*/
18+
@Json(name = "join_time_from")
19+
val joinTimeFrom: Long? = null,
20+
21+
/**
22+
* Filter for Notetaker bots that are scheduled to join meetings until the specified time.
23+
*/
24+
@Json(name = "join_time_until")
25+
val joinTimeUntil: Long? = null,
26+
27+
/**
28+
* The maximum number of objects to return.
29+
* This field defaults to 50. The maximum allowed value is 200.
30+
*/
31+
@Json(name = "limit")
32+
val limit: Int? = null,
33+
34+
/**
35+
* An identifier that specifies which page of data to return.
36+
* This value should be taken from the [ListResponse.nextCursor] response field.
37+
*/
38+
@Json(name = "page_token")
39+
val pageToken: String? = null,
40+
41+
/**
42+
* An identifier that specifies which page of data to return.
43+
* This value should be taken from the [ListResponse.prevCursor] response field.
44+
*/
45+
@Json(name = "prev_page_token")
46+
val prevPageToken: String? = null,
47+
48+
/**
49+
* Specify fields that you want Nylas to return, as a comma-separated list.
50+
* This allows you to receive only the portion of object data that you're interested in.
51+
*/
52+
@Json(name = "select")
53+
var select: String? = null,
54+
) : IQueryParams {
55+
/**
56+
* Builder for [ListNotetakersQueryParams].
57+
*/
58+
class Builder {
59+
private var state: Notetaker.NotetakerState? = null
60+
private var joinTimeFrom: Long? = null
61+
private var joinTimeUntil: Long? = null
62+
private var limit: Int? = null
63+
private var pageToken: String? = null
64+
private var prevPageToken: String? = null
65+
private var select: String? = null
66+
67+
/**
68+
* Sets the state filter for Notetakers.
69+
* @param state The meeting state to filter by.
70+
* @return The builder.
71+
*/
72+
fun state(state: Notetaker.NotetakerState?) = apply { this.state = state }
73+
74+
/**
75+
* Sets the join time from filter.
76+
* @param joinTimeFrom Unix timestamp to filter Notetakers joining after this time.
77+
* @return The builder.
78+
*/
79+
fun joinTimeFrom(joinTimeFrom: Long?) = apply { this.joinTimeFrom = joinTimeFrom }
80+
81+
/**
82+
* Sets the join time until filter.
83+
* @param joinTimeUntil Unix timestamp to filter Notetakers joining until this time.
84+
* @return The builder.
85+
*/
86+
fun joinTimeUntil(joinTimeUntil: Long?) = apply { this.joinTimeUntil = joinTimeUntil }
87+
88+
/**
89+
* Sets the maximum number of objects to return.
90+
* @param limit The maximum number of objects to return.
91+
* @return The builder.
92+
*/
93+
fun limit(limit: Int?) = apply { this.limit = limit }
94+
95+
/**
96+
* Sets the page token for pagination.
97+
* @param pageToken The page token for the next page of results.
98+
* @return The builder.
99+
*/
100+
fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken }
101+
102+
/**
103+
* Sets the previous page token for pagination.
104+
* @param prevPageToken The page token for the previous page of results.
105+
* @return The builder.
106+
*/
107+
fun prevPageToken(prevPageToken: String?) = apply { this.prevPageToken = prevPageToken }
108+
109+
/**
110+
* Sets the fields to return in the response.
111+
* @param select List of field names to return (e.g. "id,updated_at")
112+
* @return The builder.
113+
*/
114+
fun select(select: String?) = apply { this.select = select }
115+
116+
/**
117+
* Builds the [ListNotetakersQueryParams] object.
118+
* @return The [ListNotetakersQueryParams] object.
119+
*/
120+
fun build() = ListNotetakersQueryParams(
121+
state = state,
122+
joinTimeFrom = joinTimeFrom,
123+
joinTimeUntil = joinTimeUntil,
124+
limit = limit,
125+
pageToken = pageToken,
126+
prevPageToken = prevPageToken,
127+
select = select,
128+
)
129+
}
130+
}

0 commit comments

Comments
 (0)