2121
2222 from apify_client ._types import Timeout
2323
24+ _SORT_BY_TO_API : dict [str , str ] = {
25+ 'created_at' : 'createdAt' ,
26+ 'last_run_started_at' : 'stats.lastRunStartedAt' ,
27+ }
28+
2429
2530@docs_group ('Resource clients' )
2631class ActorCollectionClient (ResourceClient ):
@@ -48,7 +53,7 @@ def list(
4853 limit : int | None = None ,
4954 offset : int | None = None ,
5055 desc : bool | None = None ,
51- sort_by : Literal ['createdAt ' , 'stats.lastRunStartedAt ' ] | None = 'createdAt ' ,
56+ sort_by : Literal ['created_at ' , 'last_run_started_at ' ] | None = 'created_at ' ,
5257 timeout : Timeout = 'medium' ,
5358 ) -> ListOfActors :
5459 """List the Actors the user has created or used.
@@ -66,7 +71,8 @@ def list(
6671 Returns:
6772 The list of available Actors matching the specified filters.
6873 """
69- result = self ._list (timeout = timeout , my = my , limit = limit , offset = offset , desc = desc , sortBy = sort_by )
74+ api_sort_by = _SORT_BY_TO_API [sort_by ] if sort_by is not None else None
75+ result = self ._list (timeout = timeout , my = my , limit = limit , offset = offset , desc = desc , sortBy = api_sort_by )
7076 return ListOfActorsResponse .model_validate (result ).data
7177
7278 def create (
@@ -193,7 +199,7 @@ async def list(
193199 limit : int | None = None ,
194200 offset : int | None = None ,
195201 desc : bool | None = None ,
196- sort_by : Literal ['createdAt ' , 'stats.lastRunStartedAt ' ] | None = 'createdAt ' ,
202+ sort_by : Literal ['created_at ' , 'last_run_started_at ' ] | None = 'created_at ' ,
197203 timeout : Timeout = 'medium' ,
198204 ) -> ListOfActors :
199205 """List the Actors the user has created or used.
@@ -211,7 +217,8 @@ async def list(
211217 Returns:
212218 The list of available Actors matching the specified filters.
213219 """
214- result = await self ._list (timeout = timeout , my = my , limit = limit , offset = offset , desc = desc , sortBy = sort_by )
220+ api_sort_by = _SORT_BY_TO_API [sort_by ] if sort_by is not None else None
221+ result = await self ._list (timeout = timeout , my = my , limit = limit , offset = offset , desc = desc , sortBy = api_sort_by )
215222 return ListOfActorsResponse .model_validate (result ).data
216223
217224 async def create (
0 commit comments