Skip to content

Commit 9d7f405

Browse files
authored
Add support for terminal actor message flag (#122)
1 parent 9b1ce58 commit 9d7f405

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
[1.1.0](../../releases/tag/v1.1.0) - Unreleased
5+
6+
### Added
7+
8+
- added support for `is_status_message_terminal` flag in Actor run status message update
9+
410
[1.0.0](../../releases/tag/v1.0.0) - 2023-03-13
511
-----------------------------------------------
612

docs/docs.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,7 +1987,7 @@ Return information about the actor run.
19871987

19881988
***
19891989

1990-
#### [](#runclient-update) `RunClient.update(*, status_message=None)`
1990+
#### [](#runclient-update) `RunClient.update(*, status_message=None, is_status_message_terminal=None)`
19911991

19921992
Update the run with the specified fields.
19931993

@@ -1997,6 +1997,8 @@ Update the run with the specified fields.
19971997

19981998
* **status_message** (`str`, *optional*) – The new status message for the run
19991999

2000+
* **is_status_message_terminal** (`bool`, *optional*) – Set this flag to True if this is the final status message of the Actor run.
2001+
20002002
* **Returns**
20012003

20022004
The updated run
@@ -4190,7 +4192,7 @@ Return information about the actor run.
41904192

41914193
***
41924194

4193-
#### [](#runclientasync-update) `async RunClientAsync.update(*, status_message=None)`
4195+
#### [](#runclientasync-update) `async RunClientAsync.update(*, status_message=None, is_status_message_terminal=None)`
41944196

41954197
Update the run with the specified fields.
41964198

@@ -4200,6 +4202,8 @@ Update the run with the specified fields.
42004202

42014203
* **status_message** (`str`, *optional*) – The new status message for the run
42024204

4205+
* **is_status_message_terminal** (`bool`, *optional*) – Set this flag to True if this is the final status message of the Actor run.
4206+
42034207
* **Returns**
42044208

42054209
The updated run

src/apify_client/clients/resource_clients/run.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,21 @@ def get(self) -> Optional[Dict]:
3434
"""
3535
return self._get()
3636

37-
def update(self, *, status_message: Optional[str] = None) -> Dict:
37+
def update(self, *, status_message: Optional[str] = None, is_status_message_terminal: Optional[bool] = None) -> Dict:
3838
"""Update the run with the specified fields.
3939
4040
https://docs.apify.com/api/v2#/reference/actor-runs/run-object/update-run
4141
4242
Args:
4343
status_message (str, optional): The new status message for the run
44+
is_status_message_terminal (bool, optional): Set this flag to True if this is the final status message of the Actor run.
4445
4546
Returns:
4647
dict: The updated run
4748
"""
4849
updated_fields = {
4950
'statusMessage': status_message,
51+
'isStatusMessageTerminal': is_status_message_terminal,
5052
}
5153

5254
return self._update(_filter_out_none_values_recursively(updated_fields))
@@ -206,19 +208,21 @@ async def get(self) -> Optional[Dict]:
206208
"""
207209
return await self._get()
208210

209-
async def update(self, *, status_message: Optional[str] = None) -> Dict:
211+
async def update(self, *, status_message: Optional[str] = None, is_status_message_terminal: Optional[bool] = None) -> Dict:
210212
"""Update the run with the specified fields.
211213
212214
https://docs.apify.com/api/v2#/reference/actor-runs/run-object/update-run
213215
214216
Args:
215217
status_message (str, optional): The new status message for the run
218+
is_status_message_terminal (bool, optional): Set this flag to True if this is the final status message of the Actor run.
216219
217220
Returns:
218221
dict: The updated run
219222
"""
220223
updated_fields = {
221224
'statusMessage': status_message,
225+
'isStatusMessageTerminal': is_status_message_terminal,
222226
}
223227

224228
return await self._update(_filter_out_none_values_recursively(updated_fields))

0 commit comments

Comments
 (0)