|
2 | 2 |
|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
5 |
| -from typing import Type, Optional, cast |
| 5 | +from typing import Any, 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, |
31 | 32 | OutputOptionsParam,
|
32 | 33 | job_create_params,
|
33 | 34 | job_delete_params,
|
@@ -301,7 +302,7 @@ def delete(
|
301 | 302 | extra_query: Query | None = None,
|
302 | 303 | extra_body: Body | None = None,
|
303 | 304 | timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
304 |
| - ) -> object: |
| 305 | + ) -> Optional[JobDeleteResponse]: |
305 | 306 | """
|
306 | 307 | Deletes a Logpush job.
|
307 | 308 |
|
@@ -332,17 +333,22 @@ def delete(
|
332 | 333 |
|
333 | 334 | account_or_zone = "zones"
|
334 | 335 | account_or_zone_id = zone_id
|
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, |
| 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 |
344 | 351 | ),
|
345 |
| - cast_to=cast(Type[object], ResultWrapper[object]), |
346 | 352 | )
|
347 | 353 |
|
348 | 354 | def get(
|
@@ -665,7 +671,7 @@ async def delete(
|
665 | 671 | extra_query: Query | None = None,
|
666 | 672 | extra_body: Body | None = None,
|
667 | 673 | timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
668 |
| - ) -> object: |
| 674 | + ) -> Optional[JobDeleteResponse]: |
669 | 675 | """
|
670 | 676 | Deletes a Logpush job.
|
671 | 677 |
|
@@ -696,17 +702,22 @@ async def delete(
|
696 | 702 |
|
697 | 703 | account_or_zone = "zones"
|
698 | 704 | account_or_zone_id = zone_id
|
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, |
| 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 |
708 | 720 | ),
|
709 |
| - cast_to=cast(Type[object], ResultWrapper[object]), |
710 | 721 | )
|
711 | 722 |
|
712 | 723 | async def get(
|
|
0 commit comments