diff --git a/CHANGELOG.md b/CHANGELOG.md index ae615843..a70cbf37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Changed * Return webhook object with secret when creating a webhook * Fixed HTTP method for rotating webhook secret +* Fixed optional field for `GetAvailabilityResponse` ## [2.0.0-beta.1] - Released 2023-08-16 diff --git a/src/main/kotlin/com/nylas/models/GetAvailabilityResponse.kt b/src/main/kotlin/com/nylas/models/GetAvailabilityResponse.kt index d50542a5..3994498d 100644 --- a/src/main/kotlin/com/nylas/models/GetAvailabilityResponse.kt +++ b/src/main/kotlin/com/nylas/models/GetAvailabilityResponse.kt @@ -11,10 +11,10 @@ data class GetAvailabilityResponse( * It will contain the order in which the accounts would be next in line to attend the proposed meeting. */ @Json(name = "order") - val order: List, + val order: List? = null, /** * The available time slots where a new meeting can be created for the requested preferences. */ @Json(name = "time_slots") - val timeSlots: List, + val timeSlots: List? = null, ) diff --git a/src/main/kotlin/com/nylas/resources/Calendars.kt b/src/main/kotlin/com/nylas/resources/Calendars.kt index 14e991e4..8b8889f1 100644 --- a/src/main/kotlin/com/nylas/resources/Calendars.kt +++ b/src/main/kotlin/com/nylas/resources/Calendars.kt @@ -94,7 +94,9 @@ class Calendars(client: NylasClient) : Resource(client, Calendar::clas .adapter(GetAvailabilityRequest::class.java) .toJson(request) - return client.executePost(path, GetAvailabilityResponse::class.java, serializedRequestBody) + val responseType = Types.newParameterizedType(Response::class.java, GetAvailabilityResponse::class.java) + + return client.executePost(path, responseType, serializedRequestBody) } /**