Skip to content

Commit

Permalink
Update Webhooks Ip Addresses (#213)
Browse files Browse the repository at this point in the history
An Array is expected, not an object. ListResponse was generating the
wrong result.

https://nylas.atlassian.net/browse/TW-2596

# License

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.

Co-authored-by: Mostafa Rashed <[email protected]>
  • Loading branch information
atejada and mrashed-dev authored Feb 21, 2024
1 parent 0b823ca commit 3da0b81
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 3da0b81

Please sign in to comment.