|
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 ( |
@@ -77,7 +77,7 @@ def create( |
77 | 77 | if not application_id: |
78 | 78 | raise ValueError(f"Expected a non-empty value for `application_id` but received {application_id!r}") |
79 | 79 | return self._post( |
80 | | - f"/v1/applications/{application_id}/jobs", |
| 80 | + path_template("/v1/applications/{application_id}/jobs", application_id=application_id), |
81 | 81 | body=maybe_transform({"inputs": inputs}, job_create_params.JobCreateParams), |
82 | 82 | options=make_request_options( |
83 | 83 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -111,7 +111,7 @@ def retrieve( |
111 | 111 | if not job_id: |
112 | 112 | raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}") |
113 | 113 | return self._get( |
114 | | - f"/v1/applications/jobs/{job_id}", |
| 114 | + path_template("/v1/applications/jobs/{job_id}", job_id=job_id), |
115 | 115 | options=make_request_options( |
116 | 116 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
117 | 117 | ), |
@@ -154,7 +154,7 @@ def list( |
154 | 154 | if not application_id: |
155 | 155 | raise ValueError(f"Expected a non-empty value for `application_id` but received {application_id!r}") |
156 | 156 | return self._get_api_list( |
157 | | - f"/v1/applications/{application_id}/jobs", |
| 157 | + path_template("/v1/applications/{application_id}/jobs", application_id=application_id), |
158 | 158 | page=SyncApplicationJobsOffset[ApplicationGenerateAsyncResponse], |
159 | 159 | options=make_request_options( |
160 | 160 | extra_headers=extra_headers, |
@@ -200,7 +200,7 @@ def retry( |
200 | 200 | if not job_id: |
201 | 201 | raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}") |
202 | 202 | return self._post( |
203 | | - f"/v1/applications/jobs/{job_id}/retry", |
| 203 | + path_template("/v1/applications/jobs/{job_id}/retry", job_id=job_id), |
204 | 204 | options=make_request_options( |
205 | 205 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
206 | 206 | ), |
@@ -258,7 +258,7 @@ async def create( |
258 | 258 | if not application_id: |
259 | 259 | raise ValueError(f"Expected a non-empty value for `application_id` but received {application_id!r}") |
260 | 260 | return await self._post( |
261 | | - f"/v1/applications/{application_id}/jobs", |
| 261 | + path_template("/v1/applications/{application_id}/jobs", application_id=application_id), |
262 | 262 | body=await async_maybe_transform({"inputs": inputs}, job_create_params.JobCreateParams), |
263 | 263 | options=make_request_options( |
264 | 264 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -292,7 +292,7 @@ async def retrieve( |
292 | 292 | if not job_id: |
293 | 293 | raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}") |
294 | 294 | return await self._get( |
295 | | - f"/v1/applications/jobs/{job_id}", |
| 295 | + path_template("/v1/applications/jobs/{job_id}", job_id=job_id), |
296 | 296 | options=make_request_options( |
297 | 297 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
298 | 298 | ), |
@@ -335,7 +335,7 @@ def list( |
335 | 335 | if not application_id: |
336 | 336 | raise ValueError(f"Expected a non-empty value for `application_id` but received {application_id!r}") |
337 | 337 | return self._get_api_list( |
338 | | - f"/v1/applications/{application_id}/jobs", |
| 338 | + path_template("/v1/applications/{application_id}/jobs", application_id=application_id), |
339 | 339 | page=AsyncApplicationJobsOffset[ApplicationGenerateAsyncResponse], |
340 | 340 | options=make_request_options( |
341 | 341 | extra_headers=extra_headers, |
@@ -381,7 +381,7 @@ async def retry( |
381 | 381 | if not job_id: |
382 | 382 | raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}") |
383 | 383 | return await self._post( |
384 | | - f"/v1/applications/jobs/{job_id}/retry", |
| 384 | + path_template("/v1/applications/jobs/{job_id}/retry", job_id=job_id), |
385 | 385 | options=make_request_options( |
386 | 386 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
387 | 387 | ), |
|
0 commit comments