From 386577f3f1862868102cc27d97f00531a6a2a8a3 Mon Sep 17 00:00:00 2001 From: Blag Date: Thu, 15 Feb 2024 22:45:36 -0500 Subject: [PATCH] Update Webhooks Ip Addresses An Array is expected, not an object. ListResponse was generating the wrong result. --- 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 5e6d1819..d7c924ed 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 ed45decc..fad34b80 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