-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into devin/1733935169-make-nylasclient-mockable
- Loading branch information
Showing
41 changed files
with
2,965 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Class representation of a booking guest. | ||
*/ | ||
data class BookingGuest( | ||
/** | ||
* The email address of the guest. | ||
*/ | ||
@Json(name = "email") | ||
val email: String, | ||
/** | ||
* The name of the guest. | ||
*/ | ||
@Json(name = "name") | ||
val name: String? = null, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Class representation of a booking organizer. | ||
*/ | ||
data class BookingOrganizer( | ||
/** | ||
* The email address of the participant designated as the organizer of the event. | ||
*/ | ||
@Json(name = "email") | ||
val email: String, | ||
/** | ||
* The name of the participant designated as the organizer of the event. | ||
*/ | ||
@Json(name = "name") | ||
val name: String? = null, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Class representation of a booking reminder. | ||
*/ | ||
data class BookingReminder( | ||
/** | ||
* The reminder type. | ||
*/ | ||
@Json(name = "type") | ||
val type: String, | ||
/** | ||
* The number of minutes before the event to send the reminder. | ||
*/ | ||
@Json(name = "minutes_before_event") | ||
val minutesBeforeEvent: Int, | ||
/** | ||
* The recipient of the reminder. | ||
*/ | ||
@Json(name = "recipient") | ||
val recipient: String? = null, | ||
/** | ||
* The subject of the email reminder. | ||
*/ | ||
@Json(name = "email_subject") | ||
val emailSubject: String? = null, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Enum for booking statuses. | ||
*/ | ||
enum class BookingStatus { | ||
@Json(name = "pending") | ||
PENDING, | ||
|
||
@Json(name = "booked") | ||
BOOKED, | ||
|
||
@Json(name = "cancelled") | ||
CANCELLED, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Enum for booking types. | ||
*/ | ||
enum class BookingType { | ||
@Json(name = "booking") | ||
BOOKING, | ||
|
||
@Json(name = "organizer-confirmation") | ||
ORGANIZER_CONFIRMATION, | ||
} |
75 changes: 75 additions & 0 deletions
75
src/main/kotlin/com/nylas/models/ConfigurationAvailability.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Class representation of availability settings. | ||
*/ | ||
data class ConfigurationAvailability( | ||
/** | ||
* The total number of minutes the event should last. | ||
*/ | ||
@Json(name = "duration_minutes") | ||
val durationMinutes: Int? = null, | ||
/** | ||
* The interval between meetings in minutes. | ||
*/ | ||
@Json(name = "interval_minutes") | ||
val intervalMinutes: Int? = null, | ||
/** | ||
* Nylas rounds each time slot to the nearest multiple of this number of minutes. | ||
*/ | ||
@Json(name = "round_to") | ||
val roundTo: Int? = null, | ||
/** | ||
* Availability rules for scheduling configuration. | ||
*/ | ||
@Json(name = "availability_rules") | ||
val availabilityRules: AvailabilityRules? = null, | ||
) { | ||
class Builder { | ||
private var durationMinutes: Int? = null | ||
private var intervalMinutes: Int? = null | ||
private var roundTo: Int? = null | ||
private var availabilityRules: AvailabilityRules? = null | ||
|
||
/** | ||
* Set the duration of the event in minutes. | ||
* @param durationMinutes The duration of the event in minutes. | ||
* @return The builder. | ||
*/ | ||
fun durationMinutes(durationMinutes: Int?) = apply { this.durationMinutes = durationMinutes } | ||
|
||
/** | ||
* Set the interval between meetings in minutes. | ||
* @param intervalMinutes The interval between meetings in minutes. | ||
* @return The builder. | ||
*/ | ||
fun intervalMinutes(intervalMinutes: Int?) = apply { this.intervalMinutes = intervalMinutes } | ||
|
||
/** | ||
* Set Nylas rounds each time slot to the nearest multiple of this number of minutes. | ||
* @param roundTo Nylas rounds each time slot to the nearest multiple of this number of minutes. | ||
* @return The builder. | ||
*/ | ||
fun roundTo(roundTo: Int?) = apply { this.roundTo = roundTo } | ||
|
||
/** | ||
* Set availability rules for scheduling configuration. | ||
* @param availabilityRules Availability rules for scheduling configuration. | ||
* @return The builder. | ||
*/ | ||
fun availabilityRules(availabilityRules: AvailabilityRules?) = apply { this.availabilityRules = availabilityRules } | ||
|
||
/** | ||
* Build the [ConfigurationAvailability]. | ||
* @return The [ConfigurationAvailability]. | ||
*/ | ||
fun build() = ConfigurationAvailability( | ||
durationMinutes, | ||
intervalMinutes, | ||
roundTo, | ||
availabilityRules, | ||
) | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/kotlin/com/nylas/models/ConfigurationAvailabilityParticipant.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Class representation of a participant in a booking. | ||
*/ | ||
|
||
data class ConfigurationAvailabilityParticipant( | ||
/** | ||
* @param calendarIds The calendar IDs that the event is created in. | ||
*/ | ||
@Json(name = "calendar_ids") | ||
val calendarIds: List<String>? = emptyList(), | ||
/** | ||
* Open hours for this participant. The endpoint searches for free time slots during these open hours. | ||
*/ | ||
@Json(name = "open_hours") | ||
val openHours: List<OpenHours>? = null, | ||
) { | ||
/** | ||
* Builder for [ConfigurationAvailabilityParticipant]. | ||
*/ | ||
class Builder { | ||
private var calendarIds: List<String>? = null | ||
private var openHours: List<OpenHours>? = null | ||
|
||
/** | ||
* Set the calendar IDs for this participant. | ||
* @param calendarIds Calendar IDs for this participant. | ||
* @return The builder. | ||
*/ | ||
fun calendarIds(calendarIds: List<String>) = apply { this.calendarIds = calendarIds } | ||
|
||
/** | ||
* Set the open hours for this participant. | ||
* @param openHours Open hours for this participant. | ||
* @return The builder. | ||
*/ | ||
fun openHours(openHours: List<OpenHours>) = apply { this.openHours = openHours } | ||
|
||
/** | ||
* Set the open hours for this participant. | ||
* @param openHours Open hours for this participant. | ||
* @return The builder. | ||
*/ | ||
fun build() = ConfigurationAvailabilityParticipant( | ||
calendarIds, | ||
openHours, | ||
) | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/com/nylas/models/ConfigurationBookingParticipant.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.nylas.models | ||
|
||
import com.squareup.moshi.Json | ||
|
||
/** | ||
* Class representation of a participant in a booking. | ||
*/ | ||
data class ConfigurationBookingParticipant( | ||
/** | ||
* The calendar ID that the event is created in. | ||
*/ | ||
@Json(name = "calendar_id") | ||
val calendarId: String? = null, | ||
) { | ||
/** | ||
* Builder for [ConfigurationBookingParticipant]. | ||
*/ | ||
class Builder { | ||
private var calendarId: String? = null | ||
|
||
/** | ||
* Set the calendar ID for this participant. | ||
* @param calendarId The calendar ID for this participant. | ||
* @return The builder. | ||
*/ | ||
fun calendarId(calendarId: String?) = apply { this.calendarId = calendarId } | ||
|
||
/** | ||
* Builds a [ConfigurationBookingParticipant] instance. | ||
* @return The [ConfigurationBookingParticipant] instance. | ||
*/ | ||
fun build() = ConfigurationBookingParticipant(calendarId) | ||
} | ||
} |
Oops, something went wrong.