Skip to content

Commit dcaa4b7

Browse files
committed
integration tests
1 parent 21c2e53 commit dcaa4b7

20 files changed

Lines changed: 151 additions & 154 deletions

‎src/apify_client/_pagination_classes.py‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -140,128 +140,128 @@ def __await__(self) -> Generator[Any, Any, PageOfKeys]:
140140

141141

142142
@dataclass
143-
class ListPageOfActors(PageOfItems[ActorShort], IterableOf[ActorShort]): ...
143+
class IterablePageOfActors(PageOfItems[ActorShort], IterableOf[ActorShort]): ...
144144

145145

146146
@dataclass
147-
class ListPageOfActorsAsync(AsyncIterableOf[ActorShort], AwaitablePage[ActorShort]): ...
147+
class IterablePageOfActorsAsync(AsyncIterableOf[ActorShort], AwaitablePage[ActorShort]): ...
148148

149149

150150
@dataclass
151-
class ListPageOfBuilds(PageOfItems[BuildShort], IterableOf[BuildShort]): ...
151+
class IterablePageOfBuilds(PageOfItems[BuildShort], IterableOf[BuildShort]): ...
152152

153153

154154
@dataclass
155-
class ListPageOfBuildsAsync(AsyncIterableOf[BuildShort], AwaitablePage[BuildShort]): ...
155+
class IterablePageOfBuildsAsync(AsyncIterableOf[BuildShort], AwaitablePage[BuildShort]): ...
156156

157157

158158
@dataclass
159-
class ListPageOfDatasets(PageOfItems[DatasetListItem], IterableOf[DatasetListItem]): ...
159+
class IterablePageOfDatasets(PageOfItems[DatasetListItem], IterableOf[DatasetListItem]): ...
160160

161161

162162
@dataclass
163-
class ListPageOfDatasetsAsync(AsyncIterableOf[DatasetListItem], AwaitablePage[DatasetListItem]): ...
163+
class IterablePageOfDatasetsAsync(AsyncIterableOf[DatasetListItem], AwaitablePage[DatasetListItem]): ...
164164

165165

166166
@dataclass
167-
class ListPageOfDatasetItems(PageOfDatasetItems, IterableOf[dict[str, Any]]): ...
167+
class IterablePageOfDatasetItems(PageOfDatasetItems, IterableOf[dict[str, Any]]): ...
168168

169169

170170
@dataclass
171-
class ListPageOfDatasetItemsAsync(AsyncIterableOf[dict[str, Any]], AwaitablePageOfDatasetItems): ...
171+
class IterablePageOfDatasetItemsAsync(AsyncIterableOf[dict[str, Any]], AwaitablePageOfDatasetItems): ...
172172

173173

174174
@dataclass
175-
class ListPageOfKeyValueStores(PageOfItems[KeyValueStore], IterableOf[KeyValueStore]): ...
175+
class IterablePageOfKeyValueStores(PageOfItems[KeyValueStore], IterableOf[KeyValueStore]): ...
176176

177177

178178
@dataclass
179-
class ListPageOfKeyValueStoresAsync(AsyncIterableOf[KeyValueStore], AwaitablePage[KeyValueStore]): ...
179+
class IterablePageOfKeyValueStoresAsync(AsyncIterableOf[KeyValueStore], AwaitablePage[KeyValueStore]): ...
180180

181181

182182
@dataclass
183-
class ListPageOfRequestQueues(PageOfItems[RequestQueueShort], IterableOf[RequestQueueShort]): ...
183+
class IterablePageOfRequestQueues(PageOfItems[RequestQueueShort], IterableOf[RequestQueueShort]): ...
184184

185185

186186
@dataclass
187-
class ListPageOfRequestQueuesAsync(AsyncIterableOf[RequestQueueShort], AwaitablePage[RequestQueueShort]): ...
187+
class IterablePageOfRequestQueuesAsync(AsyncIterableOf[RequestQueueShort], AwaitablePage[RequestQueueShort]): ...
188188

189189

190190
@dataclass
191-
class ListPageOfRuns(PageOfItems[RunShort], IterableOf[RunShort]): ...
191+
class IterablePageOfRuns(PageOfItems[RunShort], IterableOf[RunShort]): ...
192192

193193

194194
@dataclass
195-
class ListPageOfRunsAsync(AsyncIterableOf[RunShort], AwaitablePage[RunShort]): ...
195+
class IterablePageOfRunsAsync(AsyncIterableOf[RunShort], AwaitablePage[RunShort]): ...
196196

197197

198198
@dataclass
199-
class ListPageOfSchedules(PageOfItems[ScheduleShort], IterableOf[ScheduleShort]): ...
199+
class IterablePageOfSchedules(PageOfItems[ScheduleShort], IterableOf[ScheduleShort]): ...
200200

201201

202202
@dataclass
203-
class ListPageOfSchedulesAsync(AsyncIterableOf[ScheduleShort], AwaitablePage[ScheduleShort]): ...
203+
class IterablePageOfSchedulesAsync(AsyncIterableOf[ScheduleShort], AwaitablePage[ScheduleShort]): ...
204204

205205

206206
@dataclass
207-
class ListPageOfStoreActors(PageOfItems[StoreListActor], IterableOf[StoreListActor]): ...
207+
class IterablePageOfStoreActors(PageOfItems[StoreListActor], IterableOf[StoreListActor]): ...
208208

209209

210210
@dataclass
211-
class ListPageOfStoreActorsAsync(AsyncIterableOf[StoreListActor], AwaitablePage[StoreListActor]): ...
211+
class IterablePageOfStoreActorsAsync(AsyncIterableOf[StoreListActor], AwaitablePage[StoreListActor]): ...
212212

213213

214214
@dataclass
215-
class ListPageOfTasks(PageOfItems[TaskShort], IterableOf[TaskShort]): ...
215+
class IterablePageOfTasks(PageOfItems[TaskShort], IterableOf[TaskShort]): ...
216216

217217

218218
@dataclass
219-
class ListPageOfTasksAsync(AsyncIterableOf[TaskShort], AwaitablePage[TaskShort]): ...
219+
class IterablePageOfTasksAsync(AsyncIterableOf[TaskShort], AwaitablePage[TaskShort]): ...
220220

221221

222222
@dataclass
223-
class ListPageOfWebhookDispatches(PageOfItems[WebhookDispatch], IterableOf[WebhookDispatch]): ...
223+
class IterablePageOfWebhookDispatches(PageOfItems[WebhookDispatch], IterableOf[WebhookDispatch]): ...
224224

225225

226226
@dataclass
227-
class ListPageOfWebhookDispatchesAsync(AsyncIterableOf[WebhookDispatch], AwaitablePage[WebhookDispatch]): ...
227+
class IterablePageOfWebhookDispatchesAsync(AsyncIterableOf[WebhookDispatch], AwaitablePage[WebhookDispatch]): ...
228228

229229

230230
@dataclass
231-
class ListPageOfWebhooks(PageOfItems[WebhookShort], IterableOf[WebhookShort]): ...
231+
class IterablePageOfWebhooks(PageOfItems[WebhookShort], IterableOf[WebhookShort]): ...
232232

233233

234234
@dataclass
235-
class ListPageOfWebhooksAsync(AsyncIterableOf[WebhookShort], AwaitablePage[WebhookShort]): ...
235+
class IterablePageOfWebhooksAsync(AsyncIterableOf[WebhookShort], AwaitablePage[WebhookShort]): ...
236236

237237

238238
@dataclass
239-
class ListPageOfEnvVars(IterableOf[EnvVar], PageOfItemsOnlyTotal): ...
239+
class IterablePageOfEnvVars(IterableOf[EnvVar], PageOfItemsOnlyTotal): ...
240240

241241

242242
@dataclass
243-
class ListPageOfEnvVarsAsync(AsyncIterableOf[EnvVar], AwaitablePageOnlyTotal[EnvVar]): ...
243+
class IterablePageOfEnvVarsAsync(AsyncIterableOf[EnvVar], AwaitablePageOnlyTotal[EnvVar]): ...
244244

245245

246246
@dataclass
247-
class ListPageOfVersions(IterableOf[Version], PageOfItemsOnlyTotal): ...
247+
class IterablePageOfVersions(IterableOf[Version], PageOfItemsOnlyTotal): ...
248248

249249

250250
@dataclass
251-
class ListPageOfVersionsAsync(AsyncIterableOf[Version], AwaitablePageOnlyTotal[Version]): ...
251+
class IterablePageOfVersionsAsync(AsyncIterableOf[Version], AwaitablePageOnlyTotal[Version]): ...
252252

253253

254254
@dataclass
255-
class ListPageOfRequests(PageOfRequests, IterableOf[Request]): ...
255+
class IterablePageOfRequests(PageOfRequests, IterableOf[Request]): ...
256256

257257

258258
@dataclass
259-
class ListPageOfRequestsAsync(AsyncIterableOf[Request], AwaitablePageOfRequests): ...
259+
class IterablePageOfRequestsAsync(AsyncIterableOf[Request], AwaitablePageOfRequests): ...
260260

261261

262262
@dataclass
263-
class ListPageOfKeys(PageOfKeys, IterableOf[KeyValueStoreKey]): ...
263+
class IterablePageOfKeys(PageOfKeys, IterableOf[KeyValueStoreKey]): ...
264264

265265

266266
@dataclass
267-
class ListPageOfKeysAsync(AsyncIterableOf[KeyValueStoreKey], AwaitablePageOfKeys): ...
267+
class IterablePageOfKeysAsync(AsyncIterableOf[KeyValueStoreKey], AwaitablePageOfKeys): ...

‎src/apify_client/_resource_clients/actor_collection.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
build_get_iterator_async,
1919
)
2020
from apify_client._pagination_classes import (
21-
ListPageOfActors,
22-
ListPageOfActorsAsync,
21+
IterablePageOfActors,
22+
IterablePageOfActorsAsync,
2323
PageOfItems,
2424
)
2525
from apify_client._resource_clients._resource_client import ResourceClient, ResourceClientAsync
@@ -65,7 +65,7 @@ def list(
6565
desc: bool | None = None,
6666
sort_by: Literal['created_at', 'last_run_started_at'] | None = 'created_at',
6767
timeout: Timeout = 'medium',
68-
) -> ListPageOfActors:
68+
) -> IterablePageOfActors:
6969
"""List the Actors the user has created or used.
7070
7171
The returned page also supports iteration: `for item in client.list(...)` yields individual Actors
@@ -101,7 +101,7 @@ def _callback(**kwargs: Any) -> PageOfItems[ActorShort]:
101101
first_page = _callback(limit=limit, offset=offset, desc=desc)
102102
get_iterator = build_get_iterator(_callback, first_page, limit=limit, offset=offset, desc=desc)
103103

104-
return ListPageOfActors(
104+
return IterablePageOfActors(
105105
_get_iterator=get_iterator,
106106
items=first_page.items,
107107
count=first_page.count,
@@ -237,7 +237,7 @@ def list(
237237
desc: bool | None = None,
238238
sort_by: Literal['created_at', 'last_run_started_at'] | None = 'created_at',
239239
timeout: Timeout = 'medium',
240-
) -> ListPageOfActorsAsync:
240+
) -> IterablePageOfActorsAsync:
241241
"""List the Actors the user has created or used.
242242
243243
The returned page also supports iteration: `async for item in client.list(...)` yields individual Actors
@@ -275,7 +275,7 @@ async def _callback(**kwargs: Any) -> PageOfItems[ActorShort]:
275275
_callback, fetch_first_page, limit=limit, offset=offset, desc=desc
276276
)
277277

278-
return ListPageOfActorsAsync(
278+
return IterablePageOfActorsAsync(
279279
_awaitable_first_page=fetch_first_page,
280280
_get_async_iterator=get_async_iterator,
281281
)

‎src/apify_client/_resource_clients/actor_env_var_collection.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
build_get_iterator_async,
1111
)
1212
from apify_client._pagination_classes import (
13-
ListPageOfEnvVars,
14-
ListPageOfEnvVarsAsync,
13+
IterablePageOfEnvVars,
14+
IterablePageOfEnvVarsAsync,
1515
PageOfItemsOnlyTotal,
1616
)
1717
from apify_client._resource_clients._resource_client import ResourceClient, ResourceClientAsync
@@ -39,7 +39,7 @@ def __init__(
3939
**kwargs,
4040
)
4141

42-
def list(self, *, timeout: Timeout = 'short') -> ListPageOfEnvVars:
42+
def list(self, *, timeout: Timeout = 'short') -> IterablePageOfEnvVars:
4343
"""List the available Actor environment variables.
4444
4545
The returned page also supports iteration: `for item in client.list()` yields individual environment
@@ -62,7 +62,7 @@ def _callback(**kwargs: Any) -> PageOfItemsOnlyTotal[EnvVar]:
6262
first_page = _callback()
6363
get_iterator = build_get_iterator(_callback, first_page)
6464

65-
return ListPageOfEnvVars(
65+
return IterablePageOfEnvVars(
6666
_get_iterator=get_iterator,
6767
items=first_page.items,
6868
total=first_page.total,
@@ -115,7 +115,7 @@ def __init__(
115115
**kwargs,
116116
)
117117

118-
def list(self, *, timeout: Timeout = 'short') -> ListPageOfEnvVarsAsync:
118+
def list(self, *, timeout: Timeout = 'short') -> IterablePageOfEnvVarsAsync:
119119
"""List the available Actor environment variables.
120120
121121
The returned page also supports iteration: `async for item in client.list()` yields individual environment
@@ -138,7 +138,7 @@ async def _callback(**kwargs: Any) -> PageOfItemsOnlyTotal[EnvVar]:
138138
fetch_first_page = _LazyTask(_callback())
139139
get_async_iterator = build_get_iterator_async(_callback, fetch_first_page)
140140

141-
return ListPageOfEnvVarsAsync(
141+
return IterablePageOfEnvVarsAsync(
142142
_awaitable_first_page=fetch_first_page,
143143
_get_async_iterator=get_async_iterator,
144144
)

‎src/apify_client/_resource_clients/actor_version_collection.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
build_get_iterator_async,
2222
)
2323
from apify_client._pagination_classes import (
24-
ListPageOfVersions,
25-
ListPageOfVersionsAsync,
24+
IterablePageOfVersions,
25+
IterablePageOfVersionsAsync,
2626
PageOfItemsOnlyTotal,
2727
)
2828
from apify_client._resource_clients._resource_client import ResourceClient, ResourceClientAsync
@@ -53,7 +53,7 @@ def __init__(
5353
**kwargs,
5454
)
5555

56-
def list(self, *, timeout: Timeout = 'short') -> ListPageOfVersions:
56+
def list(self, *, timeout: Timeout = 'short') -> IterablePageOfVersions:
5757
"""List the available Actor versions.
5858
5959
The returned page also supports iteration: `for item in client.list()` yields individual versions.
@@ -75,7 +75,7 @@ def _callback(**kwargs: Any) -> PageOfItemsOnlyTotal[Version]:
7575
first_page = _callback()
7676
get_iterator = build_get_iterator(_callback, first_page)
7777

78-
return ListPageOfVersions(
78+
return IterablePageOfVersions(
7979
_get_iterator=get_iterator,
8080
items=first_page.items,
8181
total=first_page.total,
@@ -154,7 +154,7 @@ def __init__(
154154
**kwargs,
155155
)
156156

157-
def list(self, *, timeout: Timeout = 'short') -> ListPageOfVersionsAsync:
157+
def list(self, *, timeout: Timeout = 'short') -> IterablePageOfVersionsAsync:
158158
"""List the available Actor versions.
159159
160160
The returned page also supports iteration: `async for item in client.list()` yields individual versions.
@@ -176,7 +176,7 @@ async def _callback(**kwargs: Any) -> PageOfItemsOnlyTotal[Version]:
176176
fetch_first_page = _LazyTask(_callback())
177177
get_async_iterator = build_get_iterator_async(_callback, fetch_first_page)
178178

179-
return ListPageOfVersionsAsync(
179+
return IterablePageOfVersionsAsync(
180180
_awaitable_first_page=fetch_first_page,
181181
_get_async_iterator=get_async_iterator,
182182
)

‎src/apify_client/_resource_clients/build_collection.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
build_get_iterator_async,
1111
)
1212
from apify_client._pagination_classes import (
13-
ListPageOfBuilds,
14-
ListPageOfBuildsAsync,
13+
IterablePageOfBuilds,
14+
IterablePageOfBuildsAsync,
1515
PageOfItems,
1616
)
1717
from apify_client._resource_clients._resource_client import ResourceClient, ResourceClientAsync
@@ -47,7 +47,7 @@ def list(
4747
offset: int | None = None,
4848
desc: bool | None = None,
4949
timeout: Timeout = 'medium',
50-
) -> ListPageOfBuilds:
50+
) -> IterablePageOfBuilds:
5151
"""List all Actor builds.
5252
5353
List all Actor builds, either of a single Actor, or all user's Actors, depending on where this client
@@ -84,7 +84,7 @@ def _callback(**kwargs: Any) -> PageOfItems[BuildShort]:
8484
first_page = _callback(limit=limit, offset=offset, desc=desc)
8585
get_iterator = build_get_iterator(_callback, first_page, limit=limit, offset=offset, desc=desc)
8686

87-
return ListPageOfBuilds(
87+
return IterablePageOfBuilds(
8888
_get_iterator=get_iterator,
8989
items=first_page.items,
9090
count=first_page.count,
@@ -121,7 +121,7 @@ def list(
121121
offset: int | None = None,
122122
desc: bool | None = None,
123123
timeout: Timeout = 'medium',
124-
) -> ListPageOfBuildsAsync:
124+
) -> IterablePageOfBuildsAsync:
125125
"""List all Actor builds.
126126
127127
List all Actor builds, either of a single Actor, or all user's Actors, depending on where this client
@@ -160,7 +160,7 @@ async def _callback(**kwargs: Any) -> PageOfItems[BuildShort]:
160160
_callback, fetch_first_page, limit=limit, offset=offset, desc=desc
161161
)
162162

163-
return ListPageOfBuildsAsync(
163+
return IterablePageOfBuildsAsync(
164164
_awaitable_first_page=fetch_first_page,
165165
_get_async_iterator=get_async_iterator,
166166
)

0 commit comments

Comments
 (0)