|
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, strip_not_given, async_maybe_transform |
| 11 | +from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform |
12 | 12 | from ..._compat import cached_property |
13 | 13 | from ..._resource import SyncAPIResource, AsyncAPIResource |
14 | 14 | from ..._response import ( |
@@ -161,7 +161,7 @@ def retrieve( |
161 | 161 | if not id: |
162 | 162 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
163 | 163 | return self._get( |
164 | | - f"/print-mail/v1/campaigns/{id}", |
| 164 | + path_template("/print-mail/v1/campaigns/{id}", id=id), |
165 | 165 | options=make_request_options( |
166 | 166 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
167 | 167 | ), |
@@ -228,7 +228,7 @@ def update( |
228 | 228 | if not id: |
229 | 229 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
230 | 230 | return self._post( |
231 | | - f"/print-mail/v1/campaigns/{id}", |
| 231 | + path_template("/print-mail/v1/campaigns/{id}", id=id), |
232 | 232 | body=maybe_transform( |
233 | 233 | { |
234 | 234 | "cheque_profile": cheque_profile, |
@@ -332,7 +332,7 @@ def delete( |
332 | 332 | if not id: |
333 | 333 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
334 | 334 | return self._delete( |
335 | | - f"/print-mail/v1/campaigns/{id}", |
| 335 | + path_template("/print-mail/v1/campaigns/{id}", id=id), |
336 | 336 | options=make_request_options( |
337 | 337 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
338 | 338 | ), |
@@ -373,7 +373,7 @@ def send( |
373 | 373 | if not id: |
374 | 374 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
375 | 375 | return self._post( |
376 | | - f"/print-mail/v1/campaigns/{id}/send", |
| 376 | + path_template("/print-mail/v1/campaigns/{id}/send", id=id), |
377 | 377 | body=maybe_transform({"send_date": send_date}, campaign_send_params.CampaignSendParams), |
378 | 378 | options=make_request_options( |
379 | 379 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -512,7 +512,7 @@ async def retrieve( |
512 | 512 | if not id: |
513 | 513 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
514 | 514 | return await self._get( |
515 | | - f"/print-mail/v1/campaigns/{id}", |
| 515 | + path_template("/print-mail/v1/campaigns/{id}", id=id), |
516 | 516 | options=make_request_options( |
517 | 517 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
518 | 518 | ), |
@@ -579,7 +579,7 @@ async def update( |
579 | 579 | if not id: |
580 | 580 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
581 | 581 | return await self._post( |
582 | | - f"/print-mail/v1/campaigns/{id}", |
| 582 | + path_template("/print-mail/v1/campaigns/{id}", id=id), |
583 | 583 | body=await async_maybe_transform( |
584 | 584 | { |
585 | 585 | "cheque_profile": cheque_profile, |
@@ -683,7 +683,7 @@ async def delete( |
683 | 683 | if not id: |
684 | 684 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
685 | 685 | return await self._delete( |
686 | | - f"/print-mail/v1/campaigns/{id}", |
| 686 | + path_template("/print-mail/v1/campaigns/{id}", id=id), |
687 | 687 | options=make_request_options( |
688 | 688 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
689 | 689 | ), |
@@ -724,7 +724,7 @@ async def send( |
724 | 724 | if not id: |
725 | 725 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
726 | 726 | return await self._post( |
727 | | - f"/print-mail/v1/campaigns/{id}/send", |
| 727 | + path_template("/print-mail/v1/campaigns/{id}/send", id=id), |
728 | 728 | body=await async_maybe_transform({"send_date": send_date}, campaign_send_params.CampaignSendParams), |
729 | 729 | options=make_request_options( |
730 | 730 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
|
0 commit comments