kodexa 7.4.413228596953__py3-none-any.whl → 7.4.413228679383__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
kodexa/platform/client.py CHANGED
@@ -86,7 +86,8 @@ from kodexa.model.objects import (
86
86
  PageExtensionPack,
87
87
  PageOrganization,
88
88
  DocumentFamilyStatistics, MessageContext, PagePrompt, Prompt, GuidanceSet, PageGuidanceSet, DocumentEmbedding,
89
- DocumentExternalData, Task, PageTask, RetainedGuidance, PageRetainedGuidance,
89
+ DocumentExternalData, Task, PageTask, RetainedGuidance, PageRetainedGuidance, TaskTemplate, TaskStatus,
90
+ TaskActivity, TaskDocumentFamily, TaskTag,
90
91
  )
91
92
 
92
93
  logger = logging.getLogger()
@@ -1174,8 +1175,166 @@ class PagePipelineEndpoint(PagePipeline, PageEndpoint):
1174
1175
 
1175
1176
 
1176
1177
  class PageTaskEndpoint(PageTask, PageEndpoint):
1178
+ """
1179
+ Represents a page of tasks.
1180
+ """
1181
+ def get_type(self) -> Optional[str]:
1182
+ return "tasks"
1183
+
1184
+ class PageTaskActivityEndpoint(PageEndpoint):
1185
+ """
1186
+ Represents a page of task activities.
1187
+ """
1188
+ def get_type(self) -> Optional[str]:
1189
+ return "taskActivities"
1190
+
1191
+ class PageTaskDocumentFamilyEndpoint(PageEndpoint):
1192
+ """
1193
+ Represents a page of task document families.
1194
+ """
1177
1195
  def get_type(self) -> Optional[str]:
1178
- return "task"
1196
+ return "taskDocumentFamilies"
1197
+
1198
+ class PageTaskTagEndpoint(PageEndpoint):
1199
+ """
1200
+ Represents a page of task tags.
1201
+ """
1202
+ def get_type(self) -> Optional[str]:
1203
+ return "taskTags"
1204
+
1205
+ class TaskEndpoint(EntityEndpoint, Task):
1206
+ """
1207
+ Represents a task endpoint.
1208
+ """
1209
+ def get_type(self) -> str:
1210
+ return "tasks"
1211
+
1212
+ def create_with_request(self, task: Task, task_template: Optional[TaskTemplate] = None, document_families: Optional[List[DocumentFamily]] = None):
1213
+ """Create a task with the given request."""
1214
+ url = "/api/tasks/createTaskWithRequest"
1215
+ response = self.client.post(url, body={
1216
+ "task": task.model_dump(mode="json", by_alias=True),
1217
+ "taskTemplate": task_template.model_dump(mode="json", by_alias=True) if task_template else None,
1218
+ "documentFamilies": [df.model_dump(mode="json", by_alias=True) for df in document_families] if document_families else None
1219
+ })
1220
+ return TaskEndpoint.model_validate(response.json()).set_client(self.client)
1221
+
1222
+ def update_status(self, status: TaskStatus):
1223
+ """Update the status of the task."""
1224
+ url = f"/api/tasks/{self.id}/status"
1225
+ response = self.client.put(url, body=status)
1226
+ return TaskEndpoint.model_validate(response.json()).set_client(self.client)
1227
+
1228
+ def remove_status(self):
1229
+ """Remove the task status."""
1230
+ url = f"/api/tasks/{self.id}/status"
1231
+ response = self.client.delete(url)
1232
+ return TaskEndpoint.model_validate(response.json()).set_client(self.client)
1233
+
1234
+ def update_assignee(self, assignee: User):
1235
+ """Update the assignee of the task."""
1236
+ url = f"/api/tasks/{self.id}/assignee"
1237
+ response = self.client.put(url, body=assignee.model_dump(mode="json", by_alias=True))
1238
+ return TaskEndpoint.model_validate(response.json()).set_client(self.client)
1239
+
1240
+ def remove_assignee(self):
1241
+ """Remove the task assignee."""
1242
+ url = f"/api/tasks/{self.id}/assignee"
1243
+ response = self.client.delete(url)
1244
+ return TaskEndpoint.model_validate(response.json()).set_client(self.client)
1245
+
1246
+ class TasksEndpoint(EntitiesEndpoint):
1247
+ """
1248
+ Represents tasks endpoints.
1249
+ """
1250
+ def get_type(self) -> str:
1251
+ return "tasks"
1252
+
1253
+ def get_instance_class(self, object_dict=None):
1254
+ return TaskEndpoint
1255
+
1256
+ def get_page_class(self, object_dict=None):
1257
+ return PageTaskEndpoint
1258
+
1259
+ class TaskTemplateEndpoint(EntityEndpoint, TaskTemplate):
1260
+ """
1261
+ Represents a task template endpoint.
1262
+ """
1263
+ def get_type(self) -> str:
1264
+ return "taskTemplates"
1265
+
1266
+ class TaskTemplatesEndpoint(EntitiesEndpoint):
1267
+ """
1268
+ Represents task templates endpoints.
1269
+ """
1270
+ def get_type(self) -> str:
1271
+ return "taskTemplates"
1272
+
1273
+ def get_instance_class(self, object_dict=None):
1274
+ return TaskTemplateEndpoint
1275
+
1276
+ def get_page_class(self, object_dict=None):
1277
+ return PageTaskTemplateEndpoint
1278
+
1279
+ class TaskActivityEndpoint(EntityEndpoint, TaskActivity):
1280
+ """
1281
+ Represents a task activity endpoint.
1282
+ """
1283
+ def get_type(self) -> str:
1284
+ return "taskActivities"
1285
+
1286
+ class TaskActivitiesEndpoint(EntitiesEndpoint):
1287
+ """
1288
+ Represents task activities endpoints.
1289
+ """
1290
+ def get_type(self) -> str:
1291
+ return "taskActivities"
1292
+
1293
+ def get_instance_class(self, object_dict=None):
1294
+ return TaskActivityEndpoint
1295
+
1296
+ def get_page_class(self, object_dict=None):
1297
+ return PageTaskActivityEndpoint
1298
+
1299
+ class TaskDocumentFamilyEndpoint(EntityEndpoint, TaskDocumentFamily):
1300
+ """
1301
+ Represents a task document family endpoint.
1302
+ """
1303
+ def get_type(self) -> str:
1304
+ return "taskDocumentFamilies"
1305
+
1306
+ class TaskDocumentFamiliesEndpoint(EntitiesEndpoint):
1307
+ """
1308
+ Represents task document families endpoints.
1309
+ """
1310
+ def get_type(self) -> str:
1311
+ return "taskDocumentFamilies"
1312
+
1313
+ def get_instance_class(self, object_dict=None):
1314
+ return TaskDocumentFamilyEndpoint
1315
+
1316
+ def get_page_class(self, object_dict=None):
1317
+ return PageTaskDocumentFamilyEndpoint
1318
+
1319
+ class TaskTagEndpoint(EntityEndpoint, TaskTag):
1320
+ """
1321
+ Represents a task tag endpoint.
1322
+ """
1323
+ def get_type(self) -> str:
1324
+ return "taskTags"
1325
+
1326
+ class TaskTagsEndpoint(EntitiesEndpoint):
1327
+ """
1328
+ Represents task tags endpoints.
1329
+ """
1330
+ def get_type(self) -> str:
1331
+ return "taskTags"
1332
+
1333
+ def get_instance_class(self, object_dict=None):
1334
+ return TaskTagEndpoint
1335
+
1336
+ def get_page_class(self, object_dict=None):
1337
+ return PageTaskTagEndpoint
1179
1338
 
1180
1339
 
1181
1340
  class PageRetainedGuidanceEndpoint(PageRetainedGuidance, PageEndpoint):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.4.413228596953
3
+ Version: 7.4.413228679383
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -19,7 +19,7 @@ kodexa/model/utils.py,sha256=6R-3rFiW9irBwj0Mq5yhp7EDXkNUFaeFhr3bWmnlW4g,2961
19
19
  kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
20
20
  kodexa/pipeline/pipeline.py,sha256=Z4O6UwoISeP_HMlxm6l6kbcvFBDw3Glm7lT4cUibri4,25461
21
21
  kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
22
- kodexa/platform/client.py,sha256=UdMLp_1fcWa8bJc30AD8kwLyqM6zxWLQp57cZKYZV9Q,228861
22
+ kodexa/platform/client.py,sha256=kw1UOSwGV0zl_V0oOsSS7sP-IJzCQNyua4P52HFpO7U,233867
23
23
  kodexa/platform/interaction.py,sha256=6zpcwXKNZstUGNS6m4JsoRXAqCZPJHWI-ZN3co8nnF0,1055
24
24
  kodexa/platform/kodexa.py,sha256=tPXHO500q3S75GhKGDcaxO51Viq2PNlHmAzpBZlahgo,34857
25
25
  kodexa/selectors/__init__.py,sha256=xA9-4vpyaAZWPSk3bh2kvDLkdv6XEmm7PjFbpziiTIk,100
@@ -44,7 +44,7 @@ kodexa/testing/test_utils.py,sha256=v44p__gE7ia67W7WeHN2HBFCWSCUrCZt7G4xBNCmwf8,
44
44
  kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
45
45
  kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
47
- kodexa-7.4.413228596953.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
- kodexa-7.4.413228596953.dist-info/METADATA,sha256=xfHJukntAuWThxb0FO0wtQ8ZU-SPV3MSzrz4JA6jUw8,3528
49
- kodexa-7.4.413228596953.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
- kodexa-7.4.413228596953.dist-info/RECORD,,
47
+ kodexa-7.4.413228679383.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
+ kodexa-7.4.413228679383.dist-info/METADATA,sha256=3tV7S-10PS8-yCkEG9VWfnOzsswvfHhGhhLyVCblmPU,3528
49
+ kodexa-7.4.413228679383.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
+ kodexa-7.4.413228679383.dist-info/RECORD,,