Skip to content

Commit df5e52e

Browse files
authored
feat: Add run, build delete to client (#152)
Resolves apify/apify-core#12463 docs: apify/apify-docs#727
1 parent db765dc commit df5e52e

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
Changelog
22
=========
33

4-
[1.4.2](../../releases/tag/v1.4.2) - Unreleased
4+
[1.5.0](../../releases/tag/v1.5.0) - Unreleased
55
-----------------------------------------------
6+
### Added
7+
- added DELETE to Actor runs
8+
- added DELETE to Actor builds
69

710
### Internal changes
811

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "apify_client"
3-
version = "1.4.2"
3+
version = "1.5.0"
44
description = "Apify API client for Python"
55
readme = "README.md"
66
license = {text = "Apache Software License"}

src/apify_client/clients/resource_clients/build.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ def get(self) -> Optional[Dict]:
2424
"""
2525
return self._get()
2626

27+
def delete(self) -> None:
28+
"""Delete the build.
29+
30+
https://docs.apify.com/api/v2#/reference/actor-builds/delete-build/delete-build
31+
"""
32+
return self._delete()
33+
2734
def abort(self) -> Dict:
2835
"""Abort the actor build which is starting or currently running and return its details.
2936
@@ -76,6 +83,13 @@ async def abort(self) -> Dict:
7683
"""
7784
return await self._abort()
7885

86+
async def delete(self) -> None:
87+
"""Delete the build.
88+
89+
https://docs.apify.com/api/v2#/reference/actor-builds/delete-build/delete-build
90+
"""
91+
return await self._delete()
92+
7993
async def wait_for_finish(self, *, wait_secs: Optional[int] = None) -> Optional[Dict]:
8094
"""Wait synchronously until the build finishes or the server times out.
8195

src/apify_client/clients/resource_clients/run.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ def update(self, *, status_message: Optional[str] = None, is_status_message_term
4848

4949
return self._update(filter_out_none_values_recursively(updated_fields))
5050

51+
def delete(self) -> None:
52+
"""Delete the run.
53+
54+
https://docs.apify.com/api/v2#/reference/actor-runs/delete-run/delete-run
55+
"""
56+
return self._delete()
57+
5158
def abort(self, *, gracefully: Optional[bool] = None) -> Dict:
5259
"""Abort the actor run which is starting or currently running and return its details.
5360
@@ -283,6 +290,13 @@ async def wait_for_finish(self, *, wait_secs: Optional[int] = None) -> Optional[
283290
"""
284291
return await self._wait_for_finish(wait_secs=wait_secs)
285292

293+
async def delete(self) -> None:
294+
"""Delete the run.
295+
296+
https://docs.apify.com/api/v2#/reference/actor-runs/delete-run/delete-run
297+
"""
298+
return await self._delete()
299+
286300
async def metamorph(
287301
self,
288302
*,

0 commit comments

Comments
 (0)