diff --git a/src/main/kotlin/com/workos/webhooks/models/DirectoryDeactivatedEvent.kt b/src/main/kotlin/com/workos/webhooks/models/DirectoryDeactivatedEvent.kt deleted file mode 100644 index ad129181..00000000 --- a/src/main/kotlin/com/workos/webhooks/models/DirectoryDeactivatedEvent.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.workos.webhooks.models - -import com.fasterxml.jackson.annotation.JsonCreator -import com.workos.directorysync.models.Directory - -/** - * Webhook Event for `dsync.deactivated`. - */ -class DirectoryDeactivatedEvent @JsonCreator constructor( - @JvmField - override val id: String, - - @JvmField - override val event: EventType, - - @JvmField - override val data: Directory, - - @JvmField - override val createdAt: String -) : WebhookEvent(id, event, data, createdAt) diff --git a/src/main/kotlin/com/workos/webhooks/models/EventType.kt b/src/main/kotlin/com/workos/webhooks/models/EventType.kt index d52fbee9..0bbc98cc 100644 --- a/src/main/kotlin/com/workos/webhooks/models/EventType.kt +++ b/src/main/kotlin/com/workos/webhooks/models/EventType.kt @@ -71,11 +71,6 @@ enum class EventType( */ DirectoryActivated("dsync.activated"), - /** - * Triggers when a Directory's state changes to inactive. - */ - DirectoryDeactivated("dsync.deactivated"), - /** * Triggers when a Directory is deleted. */ diff --git a/src/main/kotlin/com/workos/webhooks/models/WebhookJsonDeserializer.kt b/src/main/kotlin/com/workos/webhooks/models/WebhookJsonDeserializer.kt index f69b5e53..290d77ac 100644 --- a/src/main/kotlin/com/workos/webhooks/models/WebhookJsonDeserializer.kt +++ b/src/main/kotlin/com/workos/webhooks/models/WebhookJsonDeserializer.kt @@ -52,7 +52,6 @@ class WebhookJsonDeserializer : JsonDeserializer() { EventType.ConnectionDeactivated -> ConnectionDeactivatedEvent(id, eventType, deserializeData(data, Connection::class.java), createdAt) EventType.ConnectionDeleted -> ConnectionDeletedEvent(id, eventType, deserializeData(data, Connection::class.java), createdAt) EventType.DirectoryActivated -> DirectoryActivatedEvent(id, eventType, deserializeData(data, Directory::class.java), createdAt) - EventType.DirectoryDeactivated -> DirectoryDeactivatedEvent(id, eventType, deserializeData(data, Directory::class.java), createdAt) EventType.DirectoryDeleted -> DirectoryDeletedEvent(id, eventType, deserializeData(data, Directory::class.java), createdAt) EventType.DirectoryUserCreated -> DirectoryUserCreatedEvent(id, eventType, deserializeData(data, User::class.java), createdAt) EventType.DirectoryUserUpdated -> DirectoryUserUpdatedEvent(id, eventType, deserializeData(data, UserUpdated::class.java), createdAt) diff --git a/src/test/kotlin/com/workos/test/webhooks/ConnectionWebhookTests.kt b/src/test/kotlin/com/workos/test/webhooks/ConnectionWebhookTests.kt index 91009ae1..759f0e3f 100644 --- a/src/test/kotlin/com/workos/test/webhooks/ConnectionWebhookTests.kt +++ b/src/test/kotlin/com/workos/test/webhooks/ConnectionWebhookTests.kt @@ -49,23 +49,6 @@ class ConnectionWebhookTests : TestBase() { assertEquals((webhook as ConnectionActivatedEvent).data.id, connectionId) } - @Test - fun constructDirectoryDirectoryDeactivatedEvent() { - val workos = createWorkOSClient() - val webhookData = generateGroupWebhookEvent(EventType.ConnectionDeactivated) - val testData = WebhooksApiTest.prepareTest(webhookData) - - val webhook = workos.webhooks.constructEvent( - webhookData, - testData["signature"] as String, - testData["secret"] as String - ) - - assertTrue(webhook is ConnectionDeactivatedEvent) - assertEquals(webhook.id, webhookId) - assertEquals((webhook as ConnectionDeactivatedEvent).data.id, connectionId) - } - @Test fun constructDirectoryDeletedEvent() { val workos = createWorkOSClient() diff --git a/src/test/kotlin/com/workos/test/webhooks/DirectoryWebhookTests.kt b/src/test/kotlin/com/workos/test/webhooks/DirectoryWebhookTests.kt index 591880cf..c0010739 100644 --- a/src/test/kotlin/com/workos/test/webhooks/DirectoryWebhookTests.kt +++ b/src/test/kotlin/com/workos/test/webhooks/DirectoryWebhookTests.kt @@ -85,23 +85,6 @@ class DirectoryWebhookTests : TestBase() { assertEquals((webhook as DirectoryActivatedEvent).data.type, DirectoryType.Unknown) } - @Test - fun constructDirectoryDirectoryDeactivatedEvent() { - val workos = createWorkOSClient() - val webhookData = generateGroupWebhookEvent(EventType.DirectoryDeactivated) - val testData = WebhooksApiTest.prepareTest(webhookData) - - val webhook = workos.webhooks.constructEvent( - webhookData, - testData["signature"] as String, - testData["secret"] as String - ) - - assertTrue(webhook is DirectoryDeactivatedEvent) - assertEquals(webhook.id, webhookId) - assertEquals((webhook as DirectoryDeactivatedEvent).data.id, directoryId) - } - @Test fun constructDirectoryDeletedEvent() { val workos = createWorkOSClient()