|
19 | 19 | connection_delete_by_provider_params, |
20 | 20 | ) |
21 | 21 | from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given |
22 | | -from .._utils import maybe_transform, async_maybe_transform |
| 22 | +from .._utils import path_template, maybe_transform, async_maybe_transform |
23 | 23 | from .._compat import cached_property |
24 | 24 | from .._resource import SyncAPIResource, AsyncAPIResource |
25 | 25 | from .._response import ( |
@@ -93,7 +93,7 @@ def create( |
93 | 93 | if not provider: |
94 | 94 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
95 | 95 | return self._post( |
96 | | - f"/v3/connections/{provider}", |
| 96 | + path_template("/v3/connections/{provider}", provider=provider), |
97 | 97 | body=maybe_transform( |
98 | 98 | { |
99 | 99 | "container_tag": container_tag, |
@@ -171,7 +171,7 @@ def configure( |
171 | 171 | if not connection_id: |
172 | 172 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
173 | 173 | return self._post( |
174 | | - f"/v3/connections/{connection_id}/configure", |
| 174 | + path_template("/v3/connections/{connection_id}/configure", connection_id=connection_id), |
175 | 175 | body=maybe_transform({"resources": resources}, connection_configure_params.ConnectionConfigureParams), |
176 | 176 | options=make_request_options( |
177 | 177 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -208,7 +208,7 @@ def delete_by_id( |
208 | 208 | if not connection_id: |
209 | 209 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
210 | 210 | return self._delete( |
211 | | - f"/v3/connections/{connection_id}", |
| 211 | + path_template("/v3/connections/{connection_id}", connection_id=connection_id), |
212 | 212 | options=make_request_options( |
213 | 213 | extra_headers=extra_headers, |
214 | 214 | extra_query=extra_query, |
@@ -250,7 +250,7 @@ def delete_by_provider( |
250 | 250 | if not provider: |
251 | 251 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
252 | 252 | return self._delete( |
253 | | - f"/v3/connections/{provider}", |
| 253 | + path_template("/v3/connections/{provider}", provider=provider), |
254 | 254 | body=maybe_transform( |
255 | 255 | {"container_tags": container_tags}, |
256 | 256 | connection_delete_by_provider_params.ConnectionDeleteByProviderParams, |
@@ -287,7 +287,7 @@ def get_by_id( |
287 | 287 | if not connection_id: |
288 | 288 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
289 | 289 | return self._get( |
290 | | - f"/v3/connections/{connection_id}", |
| 290 | + path_template("/v3/connections/{connection_id}", connection_id=connection_id), |
291 | 291 | options=make_request_options( |
292 | 292 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
293 | 293 | ), |
@@ -323,7 +323,7 @@ def get_by_tag( |
323 | 323 | if not provider: |
324 | 324 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
325 | 325 | return self._post( |
326 | | - f"/v3/connections/{provider}/connection", |
| 326 | + path_template("/v3/connections/{provider}/connection", provider=provider), |
327 | 327 | body=maybe_transform( |
328 | 328 | {"container_tags": container_tags}, connection_get_by_tag_params.ConnectionGetByTagParams |
329 | 329 | ), |
@@ -363,7 +363,7 @@ def import_( |
363 | 363 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
364 | 364 | extra_headers = {"Accept": "text/plain", **(extra_headers or {})} |
365 | 365 | return self._post( |
366 | | - f"/v3/connections/{provider}/import", |
| 366 | + path_template("/v3/connections/{provider}/import", provider=provider), |
367 | 367 | body=maybe_transform({"container_tags": container_tags}, connection_import_params.ConnectionImportParams), |
368 | 368 | options=make_request_options( |
369 | 369 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -400,7 +400,7 @@ def list_documents( |
400 | 400 | if not provider: |
401 | 401 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
402 | 402 | return self._post( |
403 | | - f"/v3/connections/{provider}/documents", |
| 403 | + path_template("/v3/connections/{provider}/documents", provider=provider), |
404 | 404 | body=maybe_transform( |
405 | 405 | {"container_tags": container_tags}, connection_list_documents_params.ConnectionListDocumentsParams |
406 | 406 | ), |
@@ -438,7 +438,7 @@ def resources( |
438 | 438 | if not connection_id: |
439 | 439 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
440 | 440 | return self._get( |
441 | | - f"/v3/connections/{connection_id}/resources", |
| 441 | + path_template("/v3/connections/{connection_id}/resources", connection_id=connection_id), |
442 | 442 | options=make_request_options( |
443 | 443 | extra_headers=extra_headers, |
444 | 444 | extra_query=extra_query, |
@@ -507,7 +507,7 @@ async def create( |
507 | 507 | if not provider: |
508 | 508 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
509 | 509 | return await self._post( |
510 | | - f"/v3/connections/{provider}", |
| 510 | + path_template("/v3/connections/{provider}", provider=provider), |
511 | 511 | body=await async_maybe_transform( |
512 | 512 | { |
513 | 513 | "container_tag": container_tag, |
@@ -587,7 +587,7 @@ async def configure( |
587 | 587 | if not connection_id: |
588 | 588 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
589 | 589 | return await self._post( |
590 | | - f"/v3/connections/{connection_id}/configure", |
| 590 | + path_template("/v3/connections/{connection_id}/configure", connection_id=connection_id), |
591 | 591 | body=await async_maybe_transform( |
592 | 592 | {"resources": resources}, connection_configure_params.ConnectionConfigureParams |
593 | 593 | ), |
@@ -626,7 +626,7 @@ async def delete_by_id( |
626 | 626 | if not connection_id: |
627 | 627 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
628 | 628 | return await self._delete( |
629 | | - f"/v3/connections/{connection_id}", |
| 629 | + path_template("/v3/connections/{connection_id}", connection_id=connection_id), |
630 | 630 | options=make_request_options( |
631 | 631 | extra_headers=extra_headers, |
632 | 632 | extra_query=extra_query, |
@@ -668,7 +668,7 @@ async def delete_by_provider( |
668 | 668 | if not provider: |
669 | 669 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
670 | 670 | return await self._delete( |
671 | | - f"/v3/connections/{provider}", |
| 671 | + path_template("/v3/connections/{provider}", provider=provider), |
672 | 672 | body=await async_maybe_transform( |
673 | 673 | {"container_tags": container_tags}, |
674 | 674 | connection_delete_by_provider_params.ConnectionDeleteByProviderParams, |
@@ -705,7 +705,7 @@ async def get_by_id( |
705 | 705 | if not connection_id: |
706 | 706 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
707 | 707 | return await self._get( |
708 | | - f"/v3/connections/{connection_id}", |
| 708 | + path_template("/v3/connections/{connection_id}", connection_id=connection_id), |
709 | 709 | options=make_request_options( |
710 | 710 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
711 | 711 | ), |
@@ -741,7 +741,7 @@ async def get_by_tag( |
741 | 741 | if not provider: |
742 | 742 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
743 | 743 | return await self._post( |
744 | | - f"/v3/connections/{provider}/connection", |
| 744 | + path_template("/v3/connections/{provider}/connection", provider=provider), |
745 | 745 | body=await async_maybe_transform( |
746 | 746 | {"container_tags": container_tags}, connection_get_by_tag_params.ConnectionGetByTagParams |
747 | 747 | ), |
@@ -781,7 +781,7 @@ async def import_( |
781 | 781 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
782 | 782 | extra_headers = {"Accept": "text/plain", **(extra_headers or {})} |
783 | 783 | return await self._post( |
784 | | - f"/v3/connections/{provider}/import", |
| 784 | + path_template("/v3/connections/{provider}/import", provider=provider), |
785 | 785 | body=await async_maybe_transform( |
786 | 786 | {"container_tags": container_tags}, connection_import_params.ConnectionImportParams |
787 | 787 | ), |
@@ -820,7 +820,7 @@ async def list_documents( |
820 | 820 | if not provider: |
821 | 821 | raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}") |
822 | 822 | return await self._post( |
823 | | - f"/v3/connections/{provider}/documents", |
| 823 | + path_template("/v3/connections/{provider}/documents", provider=provider), |
824 | 824 | body=await async_maybe_transform( |
825 | 825 | {"container_tags": container_tags}, connection_list_documents_params.ConnectionListDocumentsParams |
826 | 826 | ), |
@@ -858,7 +858,7 @@ async def resources( |
858 | 858 | if not connection_id: |
859 | 859 | raise ValueError(f"Expected a non-empty value for `connection_id` but received {connection_id!r}") |
860 | 860 | return await self._get( |
861 | | - f"/v3/connections/{connection_id}/resources", |
| 861 | + path_template("/v3/connections/{connection_id}/resources", connection_id=connection_id), |
862 | 862 | options=make_request_options( |
863 | 863 | extra_headers=extra_headers, |
864 | 864 | extra_query=extra_query, |
|
0 commit comments