|
25 | 25 | organization_list_identities_params, |
26 | 26 | ) |
27 | 27 | from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given |
28 | | -from ..._utils import maybe_transform, strip_not_given, async_maybe_transform |
| 28 | +from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform |
29 | 29 | from ..._compat import cached_property |
30 | 30 | from ..._resource import SyncAPIResource, AsyncAPIResource |
31 | 31 | from ..._response import ( |
@@ -175,7 +175,7 @@ def retrieve( |
175 | 175 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
176 | 176 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
177 | 177 | return self._get( |
178 | | - f"/organizations/{organization_id}", |
| 178 | + path_template("/organizations/{organization_id}", organization_id=organization_id), |
179 | 179 | options=make_request_options( |
180 | 180 | extra_headers=extra_headers, |
181 | 181 | extra_query=extra_query, |
@@ -219,7 +219,7 @@ def update( |
219 | 219 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
220 | 220 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
221 | 221 | return self._patch( |
222 | | - f"/organizations/{organization_id}", |
| 222 | + path_template("/organizations/{organization_id}", organization_id=organization_id), |
223 | 223 | body=maybe_transform({"name": name}, organization_update_params.OrganizationUpdateParams), |
224 | 224 | options=make_request_options( |
225 | 225 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -314,7 +314,7 @@ def exchange_token( |
314 | 314 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
315 | 315 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
316 | 316 | return self._post( |
317 | | - f"/organizations/{organization_id}/token", |
| 317 | + path_template("/organizations/{organization_id}/token", organization_id=organization_id), |
318 | 318 | options=make_request_options( |
319 | 319 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
320 | 320 | ), |
@@ -367,7 +367,7 @@ def list_identities( |
367 | 367 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
368 | 368 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
369 | 369 | return self._get( |
370 | | - f"/organizations/{organization_id}/identities", |
| 370 | + path_template("/organizations/{organization_id}/identities", organization_id=organization_id), |
371 | 371 | options=make_request_options( |
372 | 372 | extra_headers=extra_headers, |
373 | 373 | extra_query=extra_query, |
@@ -433,7 +433,7 @@ def list_roles( |
433 | 433 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
434 | 434 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
435 | 435 | return self._get( |
436 | | - f"/organizations/{organization_id}/roles", |
| 436 | + path_template("/organizations/{organization_id}/roles", organization_id=organization_id), |
437 | 437 | options=make_request_options( |
438 | 438 | extra_headers=extra_headers, |
439 | 439 | extra_query=extra_query, |
@@ -555,7 +555,7 @@ async def retrieve( |
555 | 555 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
556 | 556 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
557 | 557 | return await self._get( |
558 | | - f"/organizations/{organization_id}", |
| 558 | + path_template("/organizations/{organization_id}", organization_id=organization_id), |
559 | 559 | options=make_request_options( |
560 | 560 | extra_headers=extra_headers, |
561 | 561 | extra_query=extra_query, |
@@ -601,7 +601,7 @@ async def update( |
601 | 601 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
602 | 602 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
603 | 603 | return await self._patch( |
604 | | - f"/organizations/{organization_id}", |
| 604 | + path_template("/organizations/{organization_id}", organization_id=organization_id), |
605 | 605 | body=await async_maybe_transform({"name": name}, organization_update_params.OrganizationUpdateParams), |
606 | 606 | options=make_request_options( |
607 | 607 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -696,7 +696,7 @@ async def exchange_token( |
696 | 696 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
697 | 697 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
698 | 698 | return await self._post( |
699 | | - f"/organizations/{organization_id}/token", |
| 699 | + path_template("/organizations/{organization_id}/token", organization_id=organization_id), |
700 | 700 | options=make_request_options( |
701 | 701 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
702 | 702 | ), |
@@ -749,7 +749,7 @@ async def list_identities( |
749 | 749 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
750 | 750 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
751 | 751 | return await self._get( |
752 | | - f"/organizations/{organization_id}/identities", |
| 752 | + path_template("/organizations/{organization_id}/identities", organization_id=organization_id), |
753 | 753 | options=make_request_options( |
754 | 754 | extra_headers=extra_headers, |
755 | 755 | extra_query=extra_query, |
@@ -815,7 +815,7 @@ async def list_roles( |
815 | 815 | raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") |
816 | 816 | extra_headers = {**strip_not_given({"X-Client-Request-ID": x_client_request_id}), **(extra_headers or {})} |
817 | 817 | return await self._get( |
818 | | - f"/organizations/{organization_id}/roles", |
| 818 | + path_template("/organizations/{organization_id}/roles", organization_id=organization_id), |
819 | 819 | options=make_request_options( |
820 | 820 | extra_headers=extra_headers, |
821 | 821 | extra_query=extra_query, |
|
0 commit comments