From 3da0b817232322152c7490ae28a45e71567346e5 Mon Sep 17 00:00:00 2001 From: Blag Date: Wed, 21 Feb 2024 12:41:52 -0500 Subject: [PATCH] Update Webhooks Ip Addresses (#213) 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 <17770919+mrashed-dev@users.noreply.github.com> --- src/main/kotlin/com/nylas/resources/Webhooks.kt | 4 ++-- src/test/kotlin/com/nylas/resources/WebhooksTests.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/nylas/resources/Webhooks.kt b/src/main/kotlin/com/nylas/resources/Webhooks.kt index c58fb9ab..e9c30a26 100644 --- a/src/main/kotlin/com/nylas/resources/Webhooks.kt +++ b/src/main/kotlin/com/nylas/resources/Webhooks.kt @@ -87,9 +87,9 @@ class Webhooks(client: NylasClient) : Resource(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 { + fun ipAddresses(): Response { 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) } diff --git a/src/test/kotlin/com/nylas/resources/WebhooksTests.kt b/src/test/kotlin/com/nylas/resources/WebhooksTests.kt index a4a29f4e..ea48050d 100644 --- a/src/test/kotlin/com/nylas/resources/WebhooksTests.kt +++ b/src/test/kotlin/com/nylas/resources/WebhooksTests.kt @@ -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