|
5 | 5 | import httpx |
6 | 6 |
|
7 | 7 | from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given |
8 | | -from ..._utils import maybe_transform, async_maybe_transform |
| 8 | +from ..._utils import path_template, maybe_transform, async_maybe_transform |
9 | 9 | from ..._compat import cached_property |
10 | 10 | from ..._resource import SyncAPIResource, AsyncAPIResource |
11 | 11 | from ..._response import ( |
@@ -137,7 +137,7 @@ def retrieve( |
137 | 137 | if not schedule_id: |
138 | 138 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
139 | 139 | return self._get( |
140 | | - f"/agent/schedules/{schedule_id}", |
| 140 | + path_template("/agent/schedules/{schedule_id}", schedule_id=schedule_id), |
141 | 141 | options=make_request_options( |
142 | 142 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
143 | 143 | ), |
@@ -188,7 +188,7 @@ def update( |
188 | 188 | if not schedule_id: |
189 | 189 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
190 | 190 | return self._put( |
191 | | - f"/agent/schedules/{schedule_id}", |
| 191 | + path_template("/agent/schedules/{schedule_id}", schedule_id=schedule_id), |
192 | 192 | body=maybe_transform( |
193 | 193 | { |
194 | 194 | "cron_schedule": cron_schedule, |
@@ -255,7 +255,7 @@ def delete( |
255 | 255 | if not schedule_id: |
256 | 256 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
257 | 257 | return self._delete( |
258 | | - f"/agent/schedules/{schedule_id}", |
| 258 | + path_template("/agent/schedules/{schedule_id}", schedule_id=schedule_id), |
259 | 259 | options=make_request_options( |
260 | 260 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
261 | 261 | ), |
@@ -290,7 +290,7 @@ def pause( |
290 | 290 | if not schedule_id: |
291 | 291 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
292 | 292 | return self._post( |
293 | | - f"/agent/schedules/{schedule_id}/pause", |
| 293 | + path_template("/agent/schedules/{schedule_id}/pause", schedule_id=schedule_id), |
294 | 294 | options=make_request_options( |
295 | 295 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
296 | 296 | ), |
@@ -325,7 +325,7 @@ def resume( |
325 | 325 | if not schedule_id: |
326 | 326 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
327 | 327 | return self._post( |
328 | | - f"/agent/schedules/{schedule_id}/resume", |
| 328 | + path_template("/agent/schedules/{schedule_id}/resume", schedule_id=schedule_id), |
329 | 329 | options=make_request_options( |
330 | 330 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
331 | 331 | ), |
@@ -446,7 +446,7 @@ async def retrieve( |
446 | 446 | if not schedule_id: |
447 | 447 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
448 | 448 | return await self._get( |
449 | | - f"/agent/schedules/{schedule_id}", |
| 449 | + path_template("/agent/schedules/{schedule_id}", schedule_id=schedule_id), |
450 | 450 | options=make_request_options( |
451 | 451 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
452 | 452 | ), |
@@ -497,7 +497,7 @@ async def update( |
497 | 497 | if not schedule_id: |
498 | 498 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
499 | 499 | return await self._put( |
500 | | - f"/agent/schedules/{schedule_id}", |
| 500 | + path_template("/agent/schedules/{schedule_id}", schedule_id=schedule_id), |
501 | 501 | body=await async_maybe_transform( |
502 | 502 | { |
503 | 503 | "cron_schedule": cron_schedule, |
@@ -564,7 +564,7 @@ async def delete( |
564 | 564 | if not schedule_id: |
565 | 565 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
566 | 566 | return await self._delete( |
567 | | - f"/agent/schedules/{schedule_id}", |
| 567 | + path_template("/agent/schedules/{schedule_id}", schedule_id=schedule_id), |
568 | 568 | options=make_request_options( |
569 | 569 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
570 | 570 | ), |
@@ -599,7 +599,7 @@ async def pause( |
599 | 599 | if not schedule_id: |
600 | 600 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
601 | 601 | return await self._post( |
602 | | - f"/agent/schedules/{schedule_id}/pause", |
| 602 | + path_template("/agent/schedules/{schedule_id}/pause", schedule_id=schedule_id), |
603 | 603 | options=make_request_options( |
604 | 604 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
605 | 605 | ), |
@@ -634,7 +634,7 @@ async def resume( |
634 | 634 | if not schedule_id: |
635 | 635 | raise ValueError(f"Expected a non-empty value for `schedule_id` but received {schedule_id!r}") |
636 | 636 | return await self._post( |
637 | | - f"/agent/schedules/{schedule_id}/resume", |
| 637 | + path_template("/agent/schedules/{schedule_id}/resume", schedule_id=schedule_id), |
638 | 638 | options=make_request_options( |
639 | 639 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
640 | 640 | ), |
|
0 commit comments