Skip to content

Commit 034b32e

Browse files
committed
fix type annotations
1 parent 96dfd03 commit 034b32e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/apify_client/_resource_clients/actor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def start(
229229
run_timeout: timedelta | None = None,
230230
force_permission_level: ActorPermissionLevel | None = None,
231231
wait_for_finish: int | None = None,
232-
webhooks: list[dict | WebhookCreate] | None = None,
232+
webhooks: list[WebhookCreate] | list[dict] | None = None,
233233
timeout: Timeout = 'medium',
234234
) -> Run:
235235
"""Start the Actor and immediately return the Run object.
@@ -303,7 +303,7 @@ def call(
303303
restart_on_error: bool | None = None,
304304
memory_mbytes: int | None = None,
305305
run_timeout: timedelta | None = None,
306-
webhooks: list[dict | WebhookCreate] | None = None,
306+
webhooks: list[WebhookCreate] | list[dict] | None = None,
307307
force_permission_level: ActorPermissionLevel | None = None,
308308
wait_duration: timedelta | None = None,
309309
logger: Logger | None | Literal['default'] = 'default',
@@ -725,7 +725,7 @@ async def start(
725725
run_timeout: timedelta | None = None,
726726
force_permission_level: ActorPermissionLevel | None = None,
727727
wait_for_finish: int | None = None,
728-
webhooks: list[dict | WebhookCreate] | None = None,
728+
webhooks: list[WebhookCreate] | list[dict] | None = None,
729729
timeout: Timeout = 'medium',
730730
) -> Run:
731731
"""Start the Actor and immediately return the Run object.
@@ -799,7 +799,7 @@ async def call(
799799
restart_on_error: bool | None = None,
800800
memory_mbytes: int | None = None,
801801
run_timeout: timedelta | None = None,
802-
webhooks: list[dict | WebhookCreate] | None = None,
802+
webhooks: list[WebhookCreate] | list[dict] | None = None,
803803
force_permission_level: ActorPermissionLevel | None = None,
804804
wait_duration: timedelta | None = None,
805805
logger: Logger | None | Literal['default'] = 'default',

src/apify_client/_resource_clients/request_queue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def delete_request_lock(
366366

367367
def batch_add_requests(
368368
self,
369-
requests: list[dict | RequestInput],
369+
requests: list[RequestInput] | list[dict],
370370
*,
371371
forefront: bool = False,
372372
max_parallel: int = 1,
@@ -454,7 +454,7 @@ def batch_add_requests(
454454

455455
def batch_delete_requests(
456456
self,
457-
requests: list[dict | RequestDeleteInput],
457+
requests: list[RequestDeleteInput] | list[dict],
458458
*,
459459
timeout: Timeout = 'short',
460460
) -> BatchDeleteResult:
@@ -895,7 +895,7 @@ async def _batch_add_requests_worker(
895895

896896
async def batch_add_requests(
897897
self,
898-
requests: list[dict | RequestInput],
898+
requests: list[RequestInput] | list[dict],
899899
*,
900900
forefront: bool = False,
901901
max_parallel: int = 5,
@@ -985,7 +985,7 @@ async def batch_add_requests(
985985

986986
async def batch_delete_requests(
987987
self,
988-
requests: list[dict | RequestDeleteInput],
988+
requests: list[RequestDeleteInput] | list[dict],
989989
*,
990990
timeout: Timeout = 'short',
991991
) -> BatchDeleteResult:

src/apify_client/_resource_clients/task.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def start(
161161
run_timeout: timedelta | None = None,
162162
restart_on_error: bool | None = None,
163163
wait_for_finish: int | None = None,
164-
webhooks: list[dict | WebhookCreate] | None = None,
164+
webhooks: list[WebhookCreate] | list[dict] | None = None,
165165
timeout: Timeout = 'medium',
166166
) -> Run:
167167
"""Start the task and immediately return the Run object.
@@ -228,7 +228,7 @@ def call(
228228
memory_mbytes: int | None = None,
229229
run_timeout: timedelta | None = None,
230230
restart_on_error: bool | None = None,
231-
webhooks: list[dict | WebhookCreate] | None = None,
231+
webhooks: list[WebhookCreate] | list[dict] | None = None,
232232
wait_duration: timedelta | None = None,
233233
timeout: Timeout = 'no_timeout',
234234
) -> Run | None:
@@ -485,7 +485,7 @@ async def start(
485485
run_timeout: timedelta | None = None,
486486
restart_on_error: bool | None = None,
487487
wait_for_finish: int | None = None,
488-
webhooks: list[dict | WebhookCreate] | None = None,
488+
webhooks: list[WebhookCreate] | list[dict] | None = None,
489489
timeout: Timeout = 'medium',
490490
) -> Run:
491491
"""Start the task and immediately return the Run object.
@@ -552,7 +552,7 @@ async def call(
552552
memory_mbytes: int | None = None,
553553
run_timeout: timedelta | None = None,
554554
restart_on_error: bool | None = None,
555-
webhooks: list[dict | WebhookCreate] | None = None,
555+
webhooks: list[WebhookCreate] | list[dict] | None = None,
556556
wait_duration: timedelta | None = None,
557557
timeout: Timeout = 'no_timeout',
558558
) -> Run | None:

src/apify_client/_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class WebhookRepresentationList(RootModel[list[WebhookRepresentation]]):
6262
"""List of webhook representations with base64 encoding support."""
6363

6464
@classmethod
65-
def from_webhooks(cls, webhooks: list[dict | WebhookCreate]) -> WebhookRepresentationList:
65+
def from_webhooks(cls, webhooks: list[WebhookCreate] | list[dict]) -> WebhookRepresentationList:
6666
"""Construct from a list of `WebhookCreate` models or plain dicts.
6767
6868
Dicts are validated directly as `WebhookRepresentation`, so only the minimal ad-hoc webhook fields

0 commit comments

Comments
 (0)