44
55from resend import request
66from resend .pagination_helper import PaginationHelper
7- from resend .webhooks ._webhook import Webhook , WebhookStatus
7+ from resend .webhooks ._webhook import Webhook , WebhookEvent , WebhookStatus
88
99
1010class Webhooks :
@@ -78,7 +78,7 @@ class CreateParams(TypedDict):
7878 """
7979 The URL where webhook events will be sent.
8080 """
81- events : List [str ]
81+ events : List [WebhookEvent ]
8282 """
8383 Array of event types to subscribe to.
8484 See https://resend.com/docs/dashboard/webhooks/event-types for available options.
@@ -93,7 +93,7 @@ class UpdateParams(TypedDict):
9393 """
9494 The URL where webhook events will be sent.
9595 """
96- events : NotRequired [List [str ]]
96+ events : NotRequired [List [WebhookEvent ]]
9797 """
9898 Array of event types to subscribe to.
9999 """
@@ -200,11 +200,8 @@ def update(cls, params: UpdateParams) -> UpdateWebhookResponse:
200200 webhook_id = params ["webhook_id" ]
201201 path = f"/webhooks/{ webhook_id } "
202202
203- # Remove webhook_id from params before sending to API
204- update_payload = {k : v for k , v in params .items () if k != "webhook_id" }
205-
206203 resp = request .Request [Webhooks .UpdateWebhookResponse ](
207- path = path , params = cast (Dict [Any , Any ], update_payload ), verb = "patch"
204+ path = path , params = cast (Dict [Any , Any ], params ), verb = "patch"
208205 ).perform_with_content ()
209206 return resp
210207
0 commit comments