Skip to content

Commit

Permalink
Fixed optional field for GetAvailabilityResponse (#169)
Browse files Browse the repository at this point in the history
# Description
In the response object for getting availability, `order` is only
populated for round-robin events.

# License
<!-- Your PR comment must contain the following line for us to merge the
PR. -->
I confirm that this contribution is made under the terms of the MIT
license and that I have the authority necessary to make this
contribution on behalf of its copyright owner.
  • Loading branch information
mrashed-dev authored Nov 15, 2023
1 parent 3c610d3 commit 40c37c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/nylas/models/GetAvailabilityResponse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
val order: List<String>? = null,
/**
* The available time slots where a new meeting can be created for the requested preferences.
*/
@Json(name = "time_slots")
val timeSlots: List<TimeSlot>,
val timeSlots: List<TimeSlot>? = null,
)
4 changes: 3 additions & 1 deletion src/main/kotlin/com/nylas/resources/Calendars.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ class Calendars(client: NylasClient) : Resource<Calendar>(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)
}

/**
Expand Down

0 comments on commit 40c37c9

Please sign in to comment.