Skip to content

Commit db302c3

Browse files
robot-ci-heartexfern-api[bot]jombooth
authored
chore: ROOT-88: Add activity logs endpoint to Label Studio SDK (#557)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Jo Booth <[email protected]>
1 parent c96001e commit db302c3

File tree

14 files changed

+648
-93
lines changed

14 files changed

+648
-93
lines changed
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
types:
2-
ApiActivityLogsListRequestMethod:
2+
ActivityLogsListRequestMethod:
33
enum:
44
- DELETE
55
- GET
@@ -16,7 +16,7 @@ service:
1616
auth: false
1717
base-path: ''
1818
endpoints:
19-
api_activity_logs_list:
19+
list:
2020
path: /api/activity-logs/
2121
method: GET
2222
auth: true
@@ -27,13 +27,13 @@ service:
2727
openapi: openapi/openapi.yaml
2828
display-name: Get activity logs
2929
request:
30-
name: ApiActivityLogsListRequest
30+
name: ActivityLogsListRequest
3131
query-parameters:
3232
end_date:
3333
type: optional<string>
3434
docs: End date/time (ISO-8601) for log filtering.
3535
method:
36-
type: optional<ApiActivityLogsListRequestMethod>
36+
type: optional<ActivityLogsListRequestMethod>
3737
default: all
3838
docs: HTTP request method used in the log.
3939
ordering:
@@ -80,5 +80,7 @@ service:
8080
user_id: 1
8181
recordsFiltered: 1
8282
recordsTotal: 1
83+
audiences:
84+
- public
8385
source:
8486
openapi: openapi/openapi.yaml

.mock/openapi/openapi.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ paths:
8585
- Token: []
8686
summary: Get activity logs
8787
tags:
88-
- Activity Log
88+
- Activity Logs
89+
x-fern-audiences:
90+
- public
91+
x-fern-sdk-group-name: activity_logs
92+
x-fern-sdk-method-name: list
8993
/api/annotation-history/:
9094
delete:
9195
description: Delete all annotation history items for a specific annotation, task or project. This method is available only for users with administrator roles.

poetry.lock

Lines changed: 88 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,145 @@
11
# Reference
2+
## ActivityLogs
3+
<details><summary><code>client.activity_logs.<a href="src/label_studio_sdk/activity_logs/client.py">list</a>(...)</code></summary>
4+
<dl>
5+
<dd>
6+
7+
#### 📝 Description
8+
9+
<dl>
10+
<dd>
11+
12+
<dl>
13+
<dd>
14+
15+
Retrieve activity logs filtered by workspace, project, user, HTTP method, date range or search query.
16+
</dd>
17+
</dl>
18+
</dd>
19+
</dl>
20+
21+
#### 🔌 Usage
22+
23+
<dl>
24+
<dd>
25+
26+
<dl>
27+
<dd>
28+
29+
```python
30+
from label_studio_sdk import LabelStudio
31+
32+
client = LabelStudio(
33+
api_key="YOUR_API_KEY",
34+
)
35+
client.activity_logs.list()
36+
37+
```
38+
</dd>
39+
</dl>
40+
</dd>
41+
</dl>
42+
43+
#### ⚙️ Parameters
44+
45+
<dl>
46+
<dd>
47+
48+
<dl>
49+
<dd>
50+
51+
**end_date:** `typing.Optional[str]` — End date/time (ISO-8601) for log filtering.
52+
53+
</dd>
54+
</dl>
55+
56+
<dl>
57+
<dd>
58+
59+
**method:** `typing.Optional[ActivityLogsListRequestMethod]` — HTTP request method used in the log.
60+
61+
</dd>
62+
</dl>
63+
64+
<dl>
65+
<dd>
66+
67+
**ordering:** `typing.Optional[str]` — Which field to use when ordering the results.
68+
69+
</dd>
70+
</dl>
71+
72+
<dl>
73+
<dd>
74+
75+
**page:** `typing.Optional[int]` — [or "start"] Current page index.
76+
77+
</dd>
78+
</dl>
79+
80+
<dl>
81+
<dd>
82+
83+
**page_size:** `typing.Optional[int]` — [or "length"] Logs per page, use -1 to obtain all logs (might be slow).
84+
85+
</dd>
86+
</dl>
87+
88+
<dl>
89+
<dd>
90+
91+
**project:** `typing.Optional[int]` — Project ID to filter logs.
92+
93+
</dd>
94+
</dl>
95+
96+
<dl>
97+
<dd>
98+
99+
**search:** `typing.Optional[str]` — Search expression using "AND"/"OR" to filter by request URL.
100+
101+
</dd>
102+
</dl>
103+
104+
<dl>
105+
<dd>
106+
107+
**start_date:** `typing.Optional[str]` — Start date/time (ISO-8601) for log filtering.
108+
109+
</dd>
110+
</dl>
111+
112+
<dl>
113+
<dd>
114+
115+
**user:** `typing.Optional[int]` — User ID to filter logs.
116+
117+
</dd>
118+
</dl>
119+
120+
<dl>
121+
<dd>
122+
123+
**workspace:** `typing.Optional[int]` — Workspace owner ID to filter logs.
124+
125+
</dd>
126+
</dl>
127+
128+
<dl>
129+
<dd>
130+
131+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
132+
133+
</dd>
134+
</dl>
135+
</dd>
136+
</dl>
137+
138+
139+
</dd>
140+
</dl>
141+
</details>
142+
2143
## Annotations
3144
<details><summary><code>client.annotations.<a href="src/label_studio_sdk/annotations/client.py">create_bulk</a>(...)</code></summary>
4145
<dl>

src/label_studio_sdk/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from .types import (
44
ActionsEnum,
5+
ActivityLog,
6+
ActivityLogResponse,
57
AllRolesProjectList,
68
AllRolesProjectListSampling,
79
AllRolesProjectListSkipQueue,
@@ -200,6 +202,7 @@
200202
)
201203
from . import (
202204
actions,
205+
activity_logs,
203206
annotations,
204207
billing,
205208
comments,
@@ -238,6 +241,7 @@
238241
ActionsListResponseItem,
239242
ActionsListResponseItemDialog,
240243
)
244+
from .activity_logs import ActivityLogsListRequestMethod
241245
from .annotations import AnnotationBulkSerializerWithSelectedItemsRequestLastAction, AnnotationsCreateBulkResponseItem
242246
from .client import AsyncLabelStudio, LabelStudio
243247
from .environment import LabelStudioEnvironment
@@ -310,6 +314,9 @@
310314
"ActionsEnum",
311315
"ActionsListResponseItem",
312316
"ActionsListResponseItemDialog",
317+
"ActivityLog",
318+
"ActivityLogResponse",
319+
"ActivityLogsListRequestMethod",
313320
"AllRolesProjectList",
314321
"AllRolesProjectListSampling",
315322
"AllRolesProjectListSkipQueue",
@@ -560,6 +567,7 @@
560567
"WorkspaceMemberList",
561568
"__version__",
562569
"actions",
570+
"activity_logs",
563571
"annotations",
564572
"billing",
565573
"comments",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from .types import ActivityLogsListRequestMethod
4+
5+
__all__ = ["ActivityLogsListRequestMethod"]

0 commit comments

Comments
 (0)