From 95d72e937457025a6f1e8469799f4d9a76adac7d Mon Sep 17 00:00:00 2001 From: Blag Date: Wed, 25 Oct 2023 13:40:25 -0400 Subject: [PATCH] (Kotlin) Rotate secret should be post (#164) # Description (Kotlin) Right now rotateSecret is set as PUT method, although it should POST according to the documentation. This error gets generated when calling the method. ``` Exception in thread "main" java.lang.IllegalArgumentException: method PUT must have a request body. ``` # 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. --- src/main/kotlin/com/nylas/resources/Webhooks.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/nylas/resources/Webhooks.kt b/src/main/kotlin/com/nylas/resources/Webhooks.kt index d77ac43a..5e6d1819 100644 --- a/src/main/kotlin/com/nylas/resources/Webhooks.kt +++ b/src/main/kotlin/com/nylas/resources/Webhooks.kt @@ -80,7 +80,7 @@ class Webhooks(client: NylasClient) : Resource(client, Webhook::class.j fun rotateSecret(webhookId: String): Response { val path = String.format("v3/webhooks/%s/rotate-secret", webhookId) val responseType = Types.newParameterizedType(Response::class.java, WebhookWithSecret::class.java) - return client.executePut(path, responseType) + return client.executePost(path, responseType) } /**