|
2 | 2 |
|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
5 |
| -from typing import Any, Type, Optional, cast |
| 5 | +from typing import Type, Optional, cast |
6 | 6 | from typing_extensions import Literal
|
7 | 7 |
|
8 | 8 | import httpx
|
|
28 | 28 | )
|
29 | 29 | from ...types.logpush import (
|
30 | 30 | LogpushJob,
|
31 |
| - JobDeleteResponse, |
32 | 31 | OutputOptionsParam,
|
33 | 32 | job_create_params,
|
34 | 33 | job_delete_params,
|
@@ -302,7 +301,7 @@ def delete(
|
302 | 301 | extra_query: Query | None = None,
|
303 | 302 | extra_body: Body | None = None,
|
304 | 303 | timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
305 |
| - ) -> Optional[JobDeleteResponse]: |
| 304 | + ) -> object: |
306 | 305 | """
|
307 | 306 | Deletes a Logpush job.
|
308 | 307 |
|
@@ -333,22 +332,17 @@ def delete(
|
333 | 332 |
|
334 | 333 | account_or_zone = "zones"
|
335 | 334 | account_or_zone_id = zone_id
|
336 |
| - return cast( |
337 |
| - Optional[JobDeleteResponse], |
338 |
| - self._delete( |
339 |
| - f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}", |
340 |
| - body=maybe_transform(body, job_delete_params.JobDeleteParams), |
341 |
| - options=make_request_options( |
342 |
| - extra_headers=extra_headers, |
343 |
| - extra_query=extra_query, |
344 |
| - extra_body=extra_body, |
345 |
| - timeout=timeout, |
346 |
| - post_parser=ResultWrapper._unwrapper, |
347 |
| - ), |
348 |
| - cast_to=cast( |
349 |
| - Any, ResultWrapper[JobDeleteResponse] |
350 |
| - ), # Union types cannot be passed in as arguments in the type system |
| 335 | + return self._delete( |
| 336 | + f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}", |
| 337 | + body=maybe_transform(body, job_delete_params.JobDeleteParams), |
| 338 | + options=make_request_options( |
| 339 | + extra_headers=extra_headers, |
| 340 | + extra_query=extra_query, |
| 341 | + extra_body=extra_body, |
| 342 | + timeout=timeout, |
| 343 | + post_parser=ResultWrapper._unwrapper, |
351 | 344 | ),
|
| 345 | + cast_to=cast(Type[object], ResultWrapper[object]), |
352 | 346 | )
|
353 | 347 |
|
354 | 348 | def get(
|
@@ -671,7 +665,7 @@ async def delete(
|
671 | 665 | extra_query: Query | None = None,
|
672 | 666 | extra_body: Body | None = None,
|
673 | 667 | timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
674 |
| - ) -> Optional[JobDeleteResponse]: |
| 668 | + ) -> object: |
675 | 669 | """
|
676 | 670 | Deletes a Logpush job.
|
677 | 671 |
|
@@ -702,22 +696,17 @@ async def delete(
|
702 | 696 |
|
703 | 697 | account_or_zone = "zones"
|
704 | 698 | account_or_zone_id = zone_id
|
705 |
| - return cast( |
706 |
| - Optional[JobDeleteResponse], |
707 |
| - await self._delete( |
708 |
| - f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}", |
709 |
| - body=await async_maybe_transform(body, job_delete_params.JobDeleteParams), |
710 |
| - options=make_request_options( |
711 |
| - extra_headers=extra_headers, |
712 |
| - extra_query=extra_query, |
713 |
| - extra_body=extra_body, |
714 |
| - timeout=timeout, |
715 |
| - post_parser=ResultWrapper._unwrapper, |
716 |
| - ), |
717 |
| - cast_to=cast( |
718 |
| - Any, ResultWrapper[JobDeleteResponse] |
719 |
| - ), # Union types cannot be passed in as arguments in the type system |
| 699 | + return await self._delete( |
| 700 | + f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}", |
| 701 | + body=await async_maybe_transform(body, job_delete_params.JobDeleteParams), |
| 702 | + options=make_request_options( |
| 703 | + extra_headers=extra_headers, |
| 704 | + extra_query=extra_query, |
| 705 | + extra_body=extra_body, |
| 706 | + timeout=timeout, |
| 707 | + post_parser=ResultWrapper._unwrapper, |
720 | 708 | ),
|
| 709 | + cast_to=cast(Type[object], ResultWrapper[object]), |
721 | 710 | )
|
722 | 711 |
|
723 | 712 | async def get(
|
|
0 commit comments