|
30 | 30 | webhook_rotate_signing_secret_params, |
31 | 31 | ) |
32 | 32 | from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given |
33 | | -from .._utils import path_template, maybe_transform, async_maybe_transform |
| 33 | +from .._utils import maybe_transform, async_maybe_transform |
34 | 34 | from .._compat import cached_property |
35 | 35 | from .._resource import SyncAPIResource, AsyncAPIResource |
36 | 36 | from .._response import ( |
@@ -129,7 +129,7 @@ def create( |
129 | 129 | if not api_version: |
130 | 130 | raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") |
131 | 131 | return self._post( |
132 | | - path_template("/{api_version}/webhooks", api_version=api_version), |
| 132 | + self._client._build_maybe_vertex_path(api_version=api_version, path='webhooks'), |
133 | 133 | body=maybe_transform( |
134 | 134 | { |
135 | 135 | "subscribed_events": subscribed_events, |
@@ -214,7 +214,7 @@ def update( |
214 | 214 | if not id: |
215 | 215 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
216 | 216 | return self._patch( |
217 | | - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), |
| 217 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}'), |
218 | 218 | body=maybe_transform( |
219 | 219 | { |
220 | 220 | "name": name, |
@@ -272,7 +272,7 @@ def list( |
272 | 272 | if not api_version: |
273 | 273 | raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") |
274 | 274 | return self._get( |
275 | | - path_template("/{api_version}/webhooks", api_version=api_version), |
| 275 | + self._client._build_maybe_vertex_path(api_version=api_version, path='webhooks'), |
276 | 276 | options=make_request_options( |
277 | 277 | extra_headers=extra_headers, |
278 | 278 | extra_query=extra_query, |
@@ -320,7 +320,7 @@ def delete( |
320 | 320 | if not id: |
321 | 321 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
322 | 322 | return self._delete( |
323 | | - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), |
| 323 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}'), |
324 | 324 | options=make_request_options( |
325 | 325 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
326 | 326 | ), |
@@ -358,7 +358,7 @@ def get( |
358 | 358 | if not id: |
359 | 359 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
360 | 360 | return self._get( |
361 | | - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), |
| 361 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}'), |
362 | 362 | options=make_request_options( |
363 | 363 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
364 | 364 | ), |
@@ -399,7 +399,7 @@ def ping( |
399 | 399 | if not id: |
400 | 400 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
401 | 401 | return self._post( |
402 | | - path_template("/{api_version}/webhooks/{id}:ping", api_version=api_version, id=id), |
| 402 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}:ping'), |
403 | 403 | body=maybe_transform(body, webhook_ping_params.WebhookPingParams), |
404 | 404 | options=make_request_options( |
405 | 405 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -442,7 +442,7 @@ def rotate_signing_secret( |
442 | 442 | if not id: |
443 | 443 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
444 | 444 | return self._post( |
445 | | - path_template("/{api_version}/webhooks/{id}:rotateSigningSecret", api_version=api_version, id=id), |
| 445 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}:rotateSigningSecret'), |
446 | 446 | body=maybe_transform( |
447 | 447 | {"revocation_behavior": revocation_behavior}, |
448 | 448 | webhook_rotate_signing_secret_params.WebhookRotateSigningSecretParams, |
@@ -534,7 +534,7 @@ async def create( |
534 | 534 | if not api_version: |
535 | 535 | raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") |
536 | 536 | return await self._post( |
537 | | - path_template("/{api_version}/webhooks", api_version=api_version), |
| 537 | + self._client._build_maybe_vertex_path(api_version=api_version, path='webhooks'), |
538 | 538 | body=await async_maybe_transform( |
539 | 539 | { |
540 | 540 | "subscribed_events": subscribed_events, |
@@ -619,7 +619,7 @@ async def update( |
619 | 619 | if not id: |
620 | 620 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
621 | 621 | return await self._patch( |
622 | | - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), |
| 622 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}'), |
623 | 623 | body=await async_maybe_transform( |
624 | 624 | { |
625 | 625 | "name": name, |
@@ -679,7 +679,7 @@ async def list( |
679 | 679 | if not api_version: |
680 | 680 | raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") |
681 | 681 | return await self._get( |
682 | | - path_template("/{api_version}/webhooks", api_version=api_version), |
| 682 | + self._client._build_maybe_vertex_path(api_version=api_version, path='webhooks'), |
683 | 683 | options=make_request_options( |
684 | 684 | extra_headers=extra_headers, |
685 | 685 | extra_query=extra_query, |
@@ -727,7 +727,7 @@ async def delete( |
727 | 727 | if not id: |
728 | 728 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
729 | 729 | return await self._delete( |
730 | | - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), |
| 730 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}'), |
731 | 731 | options=make_request_options( |
732 | 732 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
733 | 733 | ), |
@@ -765,7 +765,7 @@ async def get( |
765 | 765 | if not id: |
766 | 766 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
767 | 767 | return await self._get( |
768 | | - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), |
| 768 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}'), |
769 | 769 | options=make_request_options( |
770 | 770 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
771 | 771 | ), |
@@ -806,7 +806,7 @@ async def ping( |
806 | 806 | if not id: |
807 | 807 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
808 | 808 | return await self._post( |
809 | | - path_template("/{api_version}/webhooks/{id}:ping", api_version=api_version, id=id), |
| 809 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}:ping'), |
810 | 810 | body=await async_maybe_transform(body, webhook_ping_params.WebhookPingParams), |
811 | 811 | options=make_request_options( |
812 | 812 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
@@ -849,7 +849,7 @@ async def rotate_signing_secret( |
849 | 849 | if not id: |
850 | 850 | raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
851 | 851 | return await self._post( |
852 | | - path_template("/{api_version}/webhooks/{id}:rotateSigningSecret", api_version=api_version, id=id), |
| 852 | + self._client._build_maybe_vertex_path(api_version=api_version, path=f'webhooks/{id}:rotateSigningSecret'), |
853 | 853 | body=await async_maybe_transform( |
854 | 854 | {"revocation_behavior": revocation_behavior}, |
855 | 855 | webhook_rotate_signing_secret_params.WebhookRotateSigningSecretParams, |
|
0 commit comments