Skip to content

Commit

Permalink
Update Webhooks Ip Addresses
Browse files Browse the repository at this point in the history
An Array is expected, not an object. ListResponse was generating the wrong result.
  • Loading branch information
atejada committed Feb 16, 2024
1 parent d5fb9f8 commit 386577f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/nylas/resources/Webhooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class Webhooks(client: NylasClient) : Resource<Webhook>(client, Webhook::class.j
* Get the current list of IP addresses that Nylas sends webhooks from
* @returns The list of IP addresses that Nylas sends webhooks from
*/
fun ipAddresses(): ListResponse<WebhookIpAddressesResponse> {
fun ipAddresses(): Response<WebhookIpAddressesResponse> {
val path = "v3/webhooks/ip-addresses"
val responseType = Types.newParameterizedType(ListResponse::class.java, WebhookIpAddressesResponse::class.java)
val responseType = Types.newParameterizedType(Response::class.java, WebhookIpAddressesResponse::class.java)
return client.executeGet(path, responseType)
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/com/nylas/resources/WebhooksTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class WebhooksTests {
)

assertEquals("v3/webhooks/ip-addresses", pathCaptor.firstValue)
assertEquals(Types.newParameterizedType(ListResponse::class.java, WebhookIpAddressesResponse::class.java), typeCaptor.firstValue)
assertEquals(Types.newParameterizedType(Response::class.java, WebhookIpAddressesResponse::class.java), typeCaptor.firstValue)
}

@Test
Expand Down

0 comments on commit 386577f

Please sign in to comment.