Skip to content

Commit d0f5bdf

Browse files
committed
refactor: webhook payload to be type 'Any' instead of 'string'
1 parent d7cd8b8 commit d0f5bdf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/miru_server_sdk/resources/webhooks.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
from __future__ import annotations
44

5-
import json
6-
from typing import cast
5+
from typing import cast, Any
76

87
from .._models import construct_type
98
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -13,22 +12,22 @@
1312

1413

1514
class WebhooksResource(SyncAPIResource):
16-
def unwrap(self, payload: str) -> UnwrapWebhookEvent:
15+
def unwrap(self, payload: Any) -> UnwrapWebhookEvent:
1716
return cast(
1817
UnwrapWebhookEvent,
1918
construct_type(
2019
type_=UnwrapWebhookEvent,
21-
value=json.loads(payload),
20+
value=payload,
2221
),
2322
)
2423

2524

2625
class AsyncWebhooksResource(AsyncAPIResource):
27-
def unwrap(self, payload: str) -> UnwrapWebhookEvent:
26+
def unwrap(self, payload: Any) -> UnwrapWebhookEvent:
2827
return cast(
2928
UnwrapWebhookEvent,
3029
construct_type(
3130
type_=UnwrapWebhookEvent,
32-
value=json.loads(payload),
31+
value=payload,
3332
),
3433
)

0 commit comments

Comments
 (0)