|
8 | 8 | import httpx |
9 | 9 |
|
10 | 10 | from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given |
11 | | -from ..._utils import maybe_transform, async_maybe_transform |
| 11 | +from ..._utils import path_template, maybe_transform, async_maybe_transform |
12 | 12 | from ..._compat import cached_property |
13 | 13 | from ..._resource import SyncAPIResource, AsyncAPIResource |
14 | 14 | from ..._response import ( |
@@ -165,7 +165,7 @@ def retrieve( |
165 | 165 | if not webhook_id: |
166 | 166 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
167 | 167 | return self._get( |
168 | | - f"/platform/webhooks/{webhook_id}", |
| 168 | + path_template("/platform/webhooks/{webhook_id}", webhook_id=webhook_id), |
169 | 169 | options=make_request_options( |
170 | 170 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
171 | 171 | ), |
@@ -229,7 +229,7 @@ def update( |
229 | 229 | if not webhook_id: |
230 | 230 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
231 | 231 | return self._patch( |
232 | | - f"/platform/webhooks/{webhook_id}", |
| 232 | + path_template("/platform/webhooks/{webhook_id}", webhook_id=webhook_id), |
233 | 233 | body=maybe_transform( |
234 | 234 | { |
235 | 235 | "enabled": enabled, |
@@ -298,7 +298,7 @@ def delete( |
298 | 298 | if not webhook_id: |
299 | 299 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
300 | 300 | return self._delete( |
301 | | - f"/platform/webhooks/{webhook_id}", |
| 301 | + path_template("/platform/webhooks/{webhook_id}", webhook_id=webhook_id), |
302 | 302 | options=make_request_options( |
303 | 303 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
304 | 304 | ), |
@@ -425,7 +425,7 @@ def replay_delivery( |
425 | 425 | if not delivery_id: |
426 | 426 | raise ValueError(f"Expected a non-empty value for `delivery_id` but received {delivery_id!r}") |
427 | 427 | return self._post( |
428 | | - f"/platform/webhooks/deliveries/{delivery_id}/replay", |
| 428 | + path_template("/platform/webhooks/deliveries/{delivery_id}/replay", delivery_id=delivery_id), |
429 | 429 | options=make_request_options( |
430 | 430 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
431 | 431 | ), |
@@ -460,7 +460,7 @@ def retrieve_delivery( |
460 | 460 | if not delivery_id: |
461 | 461 | raise ValueError(f"Expected a non-empty value for `delivery_id` but received {delivery_id!r}") |
462 | 462 | return self._get( |
463 | | - f"/platform/webhooks/deliveries/{delivery_id}", |
| 463 | + path_template("/platform/webhooks/deliveries/{delivery_id}", delivery_id=delivery_id), |
464 | 464 | options=make_request_options( |
465 | 465 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
466 | 466 | ), |
@@ -514,7 +514,7 @@ def test( |
514 | 514 | if not webhook_id: |
515 | 515 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
516 | 516 | return self._post( |
517 | | - f"/platform/webhooks/{webhook_id}/test", |
| 517 | + path_template("/platform/webhooks/{webhook_id}/test", webhook_id=webhook_id), |
518 | 518 | body=maybe_transform({"event": event}, webhook_test_params.WebhookTestParams), |
519 | 519 | options=make_request_options( |
520 | 520 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -650,7 +650,7 @@ async def retrieve( |
650 | 650 | if not webhook_id: |
651 | 651 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
652 | 652 | return await self._get( |
653 | | - f"/platform/webhooks/{webhook_id}", |
| 653 | + path_template("/platform/webhooks/{webhook_id}", webhook_id=webhook_id), |
654 | 654 | options=make_request_options( |
655 | 655 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
656 | 656 | ), |
@@ -714,7 +714,7 @@ async def update( |
714 | 714 | if not webhook_id: |
715 | 715 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
716 | 716 | return await self._patch( |
717 | | - f"/platform/webhooks/{webhook_id}", |
| 717 | + path_template("/platform/webhooks/{webhook_id}", webhook_id=webhook_id), |
718 | 718 | body=await async_maybe_transform( |
719 | 719 | { |
720 | 720 | "enabled": enabled, |
@@ -783,7 +783,7 @@ async def delete( |
783 | 783 | if not webhook_id: |
784 | 784 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
785 | 785 | return await self._delete( |
786 | | - f"/platform/webhooks/{webhook_id}", |
| 786 | + path_template("/platform/webhooks/{webhook_id}", webhook_id=webhook_id), |
787 | 787 | options=make_request_options( |
788 | 788 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
789 | 789 | ), |
@@ -910,7 +910,7 @@ async def replay_delivery( |
910 | 910 | if not delivery_id: |
911 | 911 | raise ValueError(f"Expected a non-empty value for `delivery_id` but received {delivery_id!r}") |
912 | 912 | return await self._post( |
913 | | - f"/platform/webhooks/deliveries/{delivery_id}/replay", |
| 913 | + path_template("/platform/webhooks/deliveries/{delivery_id}/replay", delivery_id=delivery_id), |
914 | 914 | options=make_request_options( |
915 | 915 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
916 | 916 | ), |
@@ -945,7 +945,7 @@ async def retrieve_delivery( |
945 | 945 | if not delivery_id: |
946 | 946 | raise ValueError(f"Expected a non-empty value for `delivery_id` but received {delivery_id!r}") |
947 | 947 | return await self._get( |
948 | | - f"/platform/webhooks/deliveries/{delivery_id}", |
| 948 | + path_template("/platform/webhooks/deliveries/{delivery_id}", delivery_id=delivery_id), |
949 | 949 | options=make_request_options( |
950 | 950 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
951 | 951 | ), |
@@ -999,7 +999,7 @@ async def test( |
999 | 999 | if not webhook_id: |
1000 | 1000 | raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}") |
1001 | 1001 | return await self._post( |
1002 | | - f"/platform/webhooks/{webhook_id}/test", |
| 1002 | + path_template("/platform/webhooks/{webhook_id}/test", webhook_id=webhook_id), |
1003 | 1003 | body=await async_maybe_transform({"event": event}, webhook_test_params.WebhookTestParams), |
1004 | 1004 | options=make_request_options( |
1005 | 1005 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
|
0 commit comments