diff --git a/src/apify_client/clients/resource_clients/actor_collection.py b/src/apify_client/clients/resource_clients/actor_collection.py index 7fc2559d..accd0d24 100644 --- a/src/apify_client/clients/resource_clients/actor_collection.py +++ b/src/apify_client/clients/resource_clients/actor_collection.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Literal from apify_shared.utils import filter_out_none_values_recursively, ignore_docs @@ -26,6 +26,7 @@ def list( limit: int | None = None, offset: int | None = None, desc: bool | None = None, + sort_by: Literal['createdAt', 'lastRunStartedAt'] | None = 'createdAt', ) -> ListPage[dict]: """List the Actors the user has created or used. @@ -36,11 +37,12 @@ def list( limit: How many Actors to list. offset: What Actor to include as first when retrieving the list. desc: Whether to sort the Actors in descending order based on their creation date. + sort_by: Field to sort the results by. Returns: The list of available Actors matching the specified filters. """ - return self._list(my=my, limit=limit, offset=offset, desc=desc) + return self._list(my=my, limit=limit, offset=offset, desc=desc, sortBy=sort_by) def create( self, @@ -150,6 +152,7 @@ async def list( limit: int | None = None, offset: int | None = None, desc: bool | None = None, + sort_by: Literal['createdAt', 'lastRunStartedAt'] | None = 'createdAt', ) -> ListPage[dict]: """List the Actors the user has created or used. @@ -160,11 +163,12 @@ async def list( limit: How many Actors to list. offset: What Actor to include as first when retrieving the list. desc: Whether to sort the Actors in descending order based on their creation date. + sort_by: Field to sort the results by. Returns: The list of available Actors matching the specified filters. """ - return await self._list(my=my, limit=limit, offset=offset, desc=desc) + return await self._list(my=my, limit=limit, offset=offset, desc=desc, sortBy=sort_by) async def create( self,