From 4a16d9b063dbc2313e90f1f85afedbb06277bedc Mon Sep 17 00:00:00 2001 From: David Blackman Date: Thu, 28 Aug 2025 15:12:11 +0200 Subject: [PATCH] fix missing organization_domain events in webhook defs --- workos/types/webhooks/webhook.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/workos/types/webhooks/webhook.py b/workos/types/webhooks/webhook.py index 016dc771..afe9e9ff 100644 --- a/workos/types/webhooks/webhook.py +++ b/workos/types/webhooks/webhook.py @@ -1,9 +1,9 @@ from typing import Literal, Union + from pydantic import Field from typing_extensions import Annotated + from workos.types.directory_sync import DirectoryGroup -from workos.types.user_management import OrganizationMembership, User -from workos.types.webhooks.webhook_model import WebhookModel from workos.types.directory_sync.directory_user import DirectoryUser from workos.types.events.authentication_payload import ( AuthenticationEmailVerificationSucceededPayload, @@ -37,16 +37,18 @@ OrganizationDomainVerificationFailedPayload, ) from workos.types.events.session_created_payload import SessionCreatedPayload -from workos.types.organizations.organization_common import OrganizationCommon from workos.types.organization_domains import OrganizationDomain +from workos.types.organizations.organization_common import OrganizationCommon from workos.types.roles.role import EventRole from workos.types.sso.connection import Connection +from workos.types.user_management import OrganizationMembership, User from workos.types.user_management.email_verification import ( EmailVerificationCommon, ) from workos.types.user_management.invitation import InvitationCommon from workos.types.user_management.magic_auth import MagicAuthCommon from workos.types.user_management.password_reset import PasswordResetCommon +from workos.types.webhooks.webhook_model import WebhookModel # README # When adding a new webhook event type, ensure the new webhook class is @@ -205,6 +207,18 @@ class OrganizationDomainVerifiedWebhook(WebhookModel[OrganizationDomain]): event: Literal["organization_domain.verified"] +class OrganizationDomainCreatedWebhook(WebhookModel[OrganizationDomain]): + event: Literal["organization_domain.created"] + + +class OrganizationDomainUpdatedWebhook(WebhookModel[OrganizationDomain]): + event: Literal["organization_domain.updated"] + + +class OrganizationDomainDeletedWebhook(WebhookModel[OrganizationDomain]): + event: Literal["organization_domain.deleted"] + + class OrganizationMembershipCreatedWebhook(WebhookModel[OrganizationMembership]): event: Literal["organization_membership.created"] @@ -286,6 +300,9 @@ class UserUpdatedWebhook(WebhookModel[User]): OrganizationCreatedWebhook, OrganizationDeletedWebhook, OrganizationUpdatedWebhook, + OrganizationDomainCreatedWebhook, + OrganizationDomainDeletedWebhook, + OrganizationDomainUpdatedWebhook, OrganizationDomainVerificationFailedWebhook, OrganizationDomainVerifiedWebhook, OrganizationMembershipCreatedWebhook,