ayon-python-api 1.2.1__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ayon-python-api-1.2.1/ayon_python_api.egg-info → ayon_python_api-1.2.3}/PKG-INFO +2 -2
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/__init__.py +18 -2
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api.py +319 -21
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/base.py +5 -0
- ayon_python_api-1.2.3/ayon_api/_api_helpers/workfiles.py +521 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/entity_hub.py +13 -5
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/graphql.py +2 -2
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/operations.py +163 -1
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/server_api.py +135 -27
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/typing.py +6 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/version.py +1 -1
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3/ayon_python_api.egg-info}/PKG-INFO +1 -1
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/pyproject.toml +4 -4
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/setup.py +1 -1
- ayon-python-api-1.2.1/ayon_api/_api_helpers/workfiles.py +0 -265
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/LICENSE +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/README.md +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/__init__.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/actions.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/activities.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/attributes.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/bundles_addons.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/dependency_packages.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/events.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/folders.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/installers.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/links.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/lists.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/products.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/projects.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/representations.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/secrets.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/tasks.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/thumbnails.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/_api_helpers/versions.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/constants.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/events.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/exceptions.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/graphql_queries.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_api/utils.py +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_python_api.egg-info/SOURCES.txt +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_python_api.egg-info/dependency_links.txt +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_python_api.egg-info/requires.txt +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/ayon_python_api.egg-info/top_level.txt +0 -0
- {ayon-python-api-1.2.1 → ayon_python_api-1.2.3}/setup.cfg +0 -0
|
@@ -80,6 +80,8 @@ from ._api import (
|
|
|
80
80
|
get_default_fields_for_type,
|
|
81
81
|
get_rest_entity_by_id,
|
|
82
82
|
send_batch_operations,
|
|
83
|
+
send_background_batch_operations,
|
|
84
|
+
get_background_operations_status,
|
|
83
85
|
get_installers,
|
|
84
86
|
create_installer,
|
|
85
87
|
update_installer,
|
|
@@ -220,11 +222,17 @@ from ._api import (
|
|
|
220
222
|
create_representation,
|
|
221
223
|
update_representation,
|
|
222
224
|
delete_representation,
|
|
225
|
+
get_workfile_entities,
|
|
226
|
+
get_workfile_entity,
|
|
227
|
+
get_workfile_entity_by_id,
|
|
228
|
+
create_workfile_entity,
|
|
229
|
+
update_workfile_entity,
|
|
230
|
+
delete_workfile_entity,
|
|
223
231
|
get_workfiles_info,
|
|
224
232
|
get_workfile_info,
|
|
225
233
|
get_workfile_info_by_id,
|
|
226
|
-
delete_workfile_info,
|
|
227
234
|
update_workfile_info,
|
|
235
|
+
delete_workfile_info,
|
|
228
236
|
get_full_link_type_name,
|
|
229
237
|
get_link_types,
|
|
230
238
|
get_link_type,
|
|
@@ -347,6 +355,8 @@ __all__ = (
|
|
|
347
355
|
"get_default_fields_for_type",
|
|
348
356
|
"get_rest_entity_by_id",
|
|
349
357
|
"send_batch_operations",
|
|
358
|
+
"send_background_batch_operations",
|
|
359
|
+
"get_background_operations_status",
|
|
350
360
|
"get_installers",
|
|
351
361
|
"create_installer",
|
|
352
362
|
"update_installer",
|
|
@@ -487,11 +497,17 @@ __all__ = (
|
|
|
487
497
|
"create_representation",
|
|
488
498
|
"update_representation",
|
|
489
499
|
"delete_representation",
|
|
500
|
+
"get_workfile_entities",
|
|
501
|
+
"get_workfile_entity",
|
|
502
|
+
"get_workfile_entity_by_id",
|
|
503
|
+
"create_workfile_entity",
|
|
504
|
+
"update_workfile_entity",
|
|
505
|
+
"delete_workfile_entity",
|
|
490
506
|
"get_workfiles_info",
|
|
491
507
|
"get_workfile_info",
|
|
492
508
|
"get_workfile_info_by_id",
|
|
493
|
-
"delete_workfile_info",
|
|
494
509
|
"update_workfile_info",
|
|
510
|
+
"delete_workfile_info",
|
|
495
511
|
"get_full_link_type_name",
|
|
496
512
|
"get_link_types",
|
|
497
513
|
"get_link_type",
|
|
@@ -48,6 +48,7 @@ if typing.TYPE_CHECKING:
|
|
|
48
48
|
ActivityReferenceType,
|
|
49
49
|
EntityListEntityType,
|
|
50
50
|
EntityListItemMode,
|
|
51
|
+
BackgroundOperationTask,
|
|
51
52
|
LinkDirection,
|
|
52
53
|
EventFilter,
|
|
53
54
|
EventStatus,
|
|
@@ -1253,6 +1254,80 @@ def send_batch_operations(
|
|
|
1253
1254
|
)
|
|
1254
1255
|
|
|
1255
1256
|
|
|
1257
|
+
def send_background_batch_operations(
|
|
1258
|
+
project_name: str,
|
|
1259
|
+
operations: list[dict[str, Any]],
|
|
1260
|
+
*,
|
|
1261
|
+
can_fail: bool = False,
|
|
1262
|
+
wait: bool = False,
|
|
1263
|
+
raise_on_fail: bool = True,
|
|
1264
|
+
) -> BackgroundOperationTask:
|
|
1265
|
+
"""Post multiple CRUD operations to server.
|
|
1266
|
+
|
|
1267
|
+
When multiple changes should be made on server side this is the best
|
|
1268
|
+
way to go. It is possible to pass multiple operations to process on a
|
|
1269
|
+
server side and do the changes in a transaction.
|
|
1270
|
+
|
|
1271
|
+
Compared to 'send_batch_operations' this function creates a task on
|
|
1272
|
+
server which then can be periodically checked for a status and
|
|
1273
|
+
receive it's result.
|
|
1274
|
+
|
|
1275
|
+
When used with 'wait' set to 'True' this method blocks until task is
|
|
1276
|
+
finished. Which makes it work as 'send_batch_operations'
|
|
1277
|
+
but safer for large operations batch as is not bound to
|
|
1278
|
+
response timeout.
|
|
1279
|
+
|
|
1280
|
+
Args:
|
|
1281
|
+
project_name (str): On which project should be operations
|
|
1282
|
+
processed.
|
|
1283
|
+
operations (list[dict[str, Any]]): Operations to be processed.
|
|
1284
|
+
can_fail (Optional[bool]): Server will try to process all
|
|
1285
|
+
operations even if one of them fails.
|
|
1286
|
+
wait (bool): Wait for operations to end.
|
|
1287
|
+
raise_on_fail (Optional[bool]): Raise exception if an operation
|
|
1288
|
+
fails. You can handle failed operations on your own
|
|
1289
|
+
when set to 'False'. Used when 'wait' is enabled.
|
|
1290
|
+
|
|
1291
|
+
Raises:
|
|
1292
|
+
ValueError: Operations can't be converted to json string.
|
|
1293
|
+
FailedOperations: When output does not contain server operations
|
|
1294
|
+
or 'raise_on_fail' is enabled and any operation fails.
|
|
1295
|
+
|
|
1296
|
+
Returns:
|
|
1297
|
+
BackgroundOperationTask: Background operation.
|
|
1298
|
+
|
|
1299
|
+
"""
|
|
1300
|
+
con = get_server_api_connection()
|
|
1301
|
+
return con.send_background_batch_operations(
|
|
1302
|
+
project_name=project_name,
|
|
1303
|
+
operations=operations,
|
|
1304
|
+
can_fail=can_fail,
|
|
1305
|
+
wait=wait,
|
|
1306
|
+
raise_on_fail=raise_on_fail,
|
|
1307
|
+
)
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
def get_background_operations_status(
|
|
1311
|
+
project_name: str,
|
|
1312
|
+
task_id: str,
|
|
1313
|
+
) -> BackgroundOperationTask:
|
|
1314
|
+
"""Get status of background operations task.
|
|
1315
|
+
|
|
1316
|
+
Args:
|
|
1317
|
+
project_name (str): Project name.
|
|
1318
|
+
task_id (str): Backgorund operation task id.
|
|
1319
|
+
|
|
1320
|
+
Returns:
|
|
1321
|
+
BackgroundOperationTask: Background operation.
|
|
1322
|
+
|
|
1323
|
+
"""
|
|
1324
|
+
con = get_server_api_connection()
|
|
1325
|
+
return con.get_background_operations_status(
|
|
1326
|
+
project_name=project_name,
|
|
1327
|
+
task_id=task_id,
|
|
1328
|
+
)
|
|
1329
|
+
|
|
1330
|
+
|
|
1256
1331
|
def get_installers(
|
|
1257
1332
|
version: Optional[str] = None,
|
|
1258
1333
|
platform_name: Optional[str] = None,
|
|
@@ -6082,8 +6157,9 @@ def delete_representation(
|
|
|
6082
6157
|
)
|
|
6083
6158
|
|
|
6084
6159
|
|
|
6085
|
-
def
|
|
6160
|
+
def get_workfile_entities(
|
|
6086
6161
|
project_name: str,
|
|
6162
|
+
*,
|
|
6087
6163
|
workfile_ids: Optional[Iterable[str]] = None,
|
|
6088
6164
|
task_ids: Optional[Iterable[str]] = None,
|
|
6089
6165
|
paths: Optional[Iterable[str]] = None,
|
|
@@ -6092,7 +6168,6 @@ def get_workfiles_info(
|
|
|
6092
6168
|
tags: Optional[Iterable[str]] = None,
|
|
6093
6169
|
has_links: Optional[str] = None,
|
|
6094
6170
|
fields: Optional[Iterable[str]] = None,
|
|
6095
|
-
own_attributes=_PLACEHOLDER,
|
|
6096
6171
|
) -> Generator[WorkfileInfoDict, None, None]:
|
|
6097
6172
|
"""Workfile info entities by passed filters.
|
|
6098
6173
|
|
|
@@ -6111,8 +6186,6 @@ def get_workfiles_info(
|
|
|
6111
6186
|
fields (Optional[Iterable[str]]): Fields to be queried for
|
|
6112
6187
|
representation. All possible fields are returned if 'None' is
|
|
6113
6188
|
passed.
|
|
6114
|
-
own_attributes (Optional[bool]): DEPRECATED: Not supported for
|
|
6115
|
-
workfiles.
|
|
6116
6189
|
|
|
6117
6190
|
Returns:
|
|
6118
6191
|
Generator[WorkfileInfoDict, None, None]: Queried workfile info
|
|
@@ -6120,7 +6193,7 @@ def get_workfiles_info(
|
|
|
6120
6193
|
|
|
6121
6194
|
"""
|
|
6122
6195
|
con = get_server_api_connection()
|
|
6123
|
-
return con.
|
|
6196
|
+
return con.get_workfile_entities(
|
|
6124
6197
|
project_name=project_name,
|
|
6125
6198
|
workfile_ids=workfile_ids,
|
|
6126
6199
|
task_ids=task_ids,
|
|
@@ -6130,16 +6203,15 @@ def get_workfiles_info(
|
|
|
6130
6203
|
tags=tags,
|
|
6131
6204
|
has_links=has_links,
|
|
6132
6205
|
fields=fields,
|
|
6133
|
-
own_attributes=own_attributes,
|
|
6134
6206
|
)
|
|
6135
6207
|
|
|
6136
6208
|
|
|
6137
|
-
def
|
|
6209
|
+
def get_workfile_entity(
|
|
6138
6210
|
project_name: str,
|
|
6139
6211
|
task_id: str,
|
|
6140
6212
|
path: str,
|
|
6213
|
+
*,
|
|
6141
6214
|
fields: Optional[Iterable[str]] = None,
|
|
6142
|
-
own_attributes=_PLACEHOLDER,
|
|
6143
6215
|
) -> Optional[WorkfileInfoDict]:
|
|
6144
6216
|
"""Workfile info entity by task id and workfile path.
|
|
6145
6217
|
|
|
@@ -6150,28 +6222,25 @@ def get_workfile_info(
|
|
|
6150
6222
|
fields (Optional[Iterable[str]]): Fields to be queried for
|
|
6151
6223
|
representation. All possible fields are returned if 'None' is
|
|
6152
6224
|
passed.
|
|
6153
|
-
own_attributes (Optional[bool]): DEPRECATED: Not supported for
|
|
6154
|
-
workfiles.
|
|
6155
6225
|
|
|
6156
6226
|
Returns:
|
|
6157
6227
|
Optional[WorkfileInfoDict]: Workfile info entity or None.
|
|
6158
6228
|
|
|
6159
6229
|
"""
|
|
6160
6230
|
con = get_server_api_connection()
|
|
6161
|
-
return con.
|
|
6231
|
+
return con.get_workfile_entity(
|
|
6162
6232
|
project_name=project_name,
|
|
6163
6233
|
task_id=task_id,
|
|
6164
6234
|
path=path,
|
|
6165
6235
|
fields=fields,
|
|
6166
|
-
own_attributes=own_attributes,
|
|
6167
6236
|
)
|
|
6168
6237
|
|
|
6169
6238
|
|
|
6170
|
-
def
|
|
6239
|
+
def get_workfile_entity_by_id(
|
|
6171
6240
|
project_name: str,
|
|
6172
6241
|
workfile_id: str,
|
|
6242
|
+
*,
|
|
6173
6243
|
fields: Optional[Iterable[str]] = None,
|
|
6174
|
-
own_attributes=_PLACEHOLDER,
|
|
6175
6244
|
) -> Optional[WorkfileInfoDict]:
|
|
6176
6245
|
"""Workfile info entity by id.
|
|
6177
6246
|
|
|
@@ -6181,23 +6250,119 @@ def get_workfile_info_by_id(
|
|
|
6181
6250
|
fields (Optional[Iterable[str]]): Fields to be queried for
|
|
6182
6251
|
representation. All possible fields are returned if 'None' is
|
|
6183
6252
|
passed.
|
|
6184
|
-
own_attributes (Optional[bool]): DEPRECATED: Not supported for
|
|
6185
|
-
workfiles.
|
|
6186
6253
|
|
|
6187
6254
|
Returns:
|
|
6188
6255
|
Optional[WorkfileInfoDict]: Workfile info entity or None.
|
|
6189
6256
|
|
|
6190
6257
|
"""
|
|
6191
6258
|
con = get_server_api_connection()
|
|
6192
|
-
return con.
|
|
6259
|
+
return con.get_workfile_entity_by_id(
|
|
6193
6260
|
project_name=project_name,
|
|
6194
6261
|
workfile_id=workfile_id,
|
|
6195
6262
|
fields=fields,
|
|
6196
|
-
own_attributes=own_attributes,
|
|
6197
6263
|
)
|
|
6198
6264
|
|
|
6199
6265
|
|
|
6200
|
-
def
|
|
6266
|
+
def create_workfile_entity(
|
|
6267
|
+
project_name: str,
|
|
6268
|
+
path: str,
|
|
6269
|
+
task_id: str,
|
|
6270
|
+
*,
|
|
6271
|
+
thumbnail_id: Optional[str] = None,
|
|
6272
|
+
attrib: Optional[dict[str, Any]] = None,
|
|
6273
|
+
data: Optional[dict[str, Any]] = None,
|
|
6274
|
+
tags: Optional[list[str]] = None,
|
|
6275
|
+
status: Optional[str] = None,
|
|
6276
|
+
active: Optional[bool] = None,
|
|
6277
|
+
workfile_id: Optional[str] = None,
|
|
6278
|
+
) -> str:
|
|
6279
|
+
"""Create new workfile.
|
|
6280
|
+
|
|
6281
|
+
Args:
|
|
6282
|
+
project_name (str): Project name.
|
|
6283
|
+
path (str): Representation name.
|
|
6284
|
+
task_id (str): Parent task id.
|
|
6285
|
+
thumbnail_id (Optional[str]): Thumbnail id.
|
|
6286
|
+
attrib (Optional[dict[str, Any]]): Representation attributes.
|
|
6287
|
+
data (Optional[dict[str, Any]]): Representation data.
|
|
6288
|
+
tags (Optional[Iterable[str]]): Representation tags.
|
|
6289
|
+
status (Optional[str]): Representation status.
|
|
6290
|
+
active (Optional[bool]): Representation active state.
|
|
6291
|
+
workfile_id (Optional[str]): Workfile info id. If not
|
|
6292
|
+
passed new id is generated.
|
|
6293
|
+
|
|
6294
|
+
Returns:
|
|
6295
|
+
str: Workfile info id.
|
|
6296
|
+
|
|
6297
|
+
"""
|
|
6298
|
+
con = get_server_api_connection()
|
|
6299
|
+
return con.create_workfile_entity(
|
|
6300
|
+
project_name=project_name,
|
|
6301
|
+
path=path,
|
|
6302
|
+
task_id=task_id,
|
|
6303
|
+
thumbnail_id=thumbnail_id,
|
|
6304
|
+
attrib=attrib,
|
|
6305
|
+
data=data,
|
|
6306
|
+
tags=tags,
|
|
6307
|
+
status=status,
|
|
6308
|
+
active=active,
|
|
6309
|
+
workfile_id=workfile_id,
|
|
6310
|
+
)
|
|
6311
|
+
|
|
6312
|
+
|
|
6313
|
+
def update_workfile_entity(
|
|
6314
|
+
project_name: str,
|
|
6315
|
+
workfile_id: str,
|
|
6316
|
+
*,
|
|
6317
|
+
path: Optional[str] = None,
|
|
6318
|
+
task_id: Optional[str] = None,
|
|
6319
|
+
attrib: Optional[dict[str, Any]] = None,
|
|
6320
|
+
data: Optional[dict[str, Any]] = None,
|
|
6321
|
+
tags: Optional[Iterable[str]] = None,
|
|
6322
|
+
status: Optional[str] = None,
|
|
6323
|
+
active: Optional[bool] = None,
|
|
6324
|
+
thumbnail_id: Optional[str] = NOT_SET,
|
|
6325
|
+
created_by: Optional[str] = None,
|
|
6326
|
+
updated_by: Optional[str] = None,
|
|
6327
|
+
) -> None:
|
|
6328
|
+
"""Update workfile entity on server.
|
|
6329
|
+
|
|
6330
|
+
Update of ``attrib`` does change only passed attributes. If you want
|
|
6331
|
+
to unset value, use ``None``.
|
|
6332
|
+
|
|
6333
|
+
Args:
|
|
6334
|
+
project_name (str): Project name.
|
|
6335
|
+
workfile_id (str): Workfile id.
|
|
6336
|
+
path (Optional[str]): New rootless workfile path..
|
|
6337
|
+
task_id (Optional[str]): New parent task id.
|
|
6338
|
+
attrib (Optional[dict[str, Any]]): New attributes.
|
|
6339
|
+
data (Optional[dict[str, Any]]): New data.
|
|
6340
|
+
tags (Optional[Iterable[str]]): New tags.
|
|
6341
|
+
status (Optional[str]): New status.
|
|
6342
|
+
active (Optional[bool]): New active state.
|
|
6343
|
+
thumbnail_id (Optional[str]): New thumbnail id.
|
|
6344
|
+
created_by (Optional[str]): New created by username.
|
|
6345
|
+
updated_by (Optional[str]): New updated by username.
|
|
6346
|
+
|
|
6347
|
+
"""
|
|
6348
|
+
con = get_server_api_connection()
|
|
6349
|
+
return con.update_workfile_entity(
|
|
6350
|
+
project_name=project_name,
|
|
6351
|
+
workfile_id=workfile_id,
|
|
6352
|
+
path=path,
|
|
6353
|
+
task_id=task_id,
|
|
6354
|
+
attrib=attrib,
|
|
6355
|
+
data=data,
|
|
6356
|
+
tags=tags,
|
|
6357
|
+
status=status,
|
|
6358
|
+
active=active,
|
|
6359
|
+
thumbnail_id=thumbnail_id,
|
|
6360
|
+
created_by=created_by,
|
|
6361
|
+
updated_by=updated_by,
|
|
6362
|
+
)
|
|
6363
|
+
|
|
6364
|
+
|
|
6365
|
+
def delete_workfile_entity(
|
|
6201
6366
|
project_name: str,
|
|
6202
6367
|
workfile_id: str,
|
|
6203
6368
|
) -> None:
|
|
@@ -6209,12 +6374,127 @@ def delete_workfile_info(
|
|
|
6209
6374
|
|
|
6210
6375
|
"""
|
|
6211
6376
|
con = get_server_api_connection()
|
|
6212
|
-
return con.
|
|
6377
|
+
return con.delete_workfile_entity(
|
|
6213
6378
|
project_name=project_name,
|
|
6214
6379
|
workfile_id=workfile_id,
|
|
6215
6380
|
)
|
|
6216
6381
|
|
|
6217
6382
|
|
|
6383
|
+
def get_workfiles_info(
|
|
6384
|
+
project_name: str,
|
|
6385
|
+
workfile_ids: Optional[Iterable[str]] = None,
|
|
6386
|
+
task_ids: Optional[Iterable[str]] = None,
|
|
6387
|
+
paths: Optional[Iterable[str]] = None,
|
|
6388
|
+
path_regex: Optional[str] = None,
|
|
6389
|
+
statuses: Optional[Iterable[str]] = None,
|
|
6390
|
+
tags: Optional[Iterable[str]] = None,
|
|
6391
|
+
has_links: Optional[str] = None,
|
|
6392
|
+
fields: Optional[Iterable[str]] = None,
|
|
6393
|
+
own_attributes=_PLACEHOLDER,
|
|
6394
|
+
) -> Generator[WorkfileInfoDict, None, None]:
|
|
6395
|
+
"""DEPRECATED Workfile info entities by passed filters.
|
|
6396
|
+
|
|
6397
|
+
Args:
|
|
6398
|
+
project_name (str): Project under which the entity is located.
|
|
6399
|
+
workfile_ids (Optional[Iterable[str]]): Workfile ids.
|
|
6400
|
+
task_ids (Optional[Iterable[str]]): Task ids.
|
|
6401
|
+
paths (Optional[Iterable[str]]): Rootless workfiles paths.
|
|
6402
|
+
path_regex (Optional[str]): Regex filter for workfile path.
|
|
6403
|
+
statuses (Optional[Iterable[str]]): Workfile info statuses used
|
|
6404
|
+
for filtering.
|
|
6405
|
+
tags (Optional[Iterable[str]]): Workfile info tags used
|
|
6406
|
+
for filtering.
|
|
6407
|
+
has_links (Optional[Literal[IN, OUT, ANY]]): Filter
|
|
6408
|
+
representations with IN/OUT/ANY links.
|
|
6409
|
+
fields (Optional[Iterable[str]]): Fields to be queried for
|
|
6410
|
+
representation. All possible fields are returned if 'None' is
|
|
6411
|
+
passed.
|
|
6412
|
+
own_attributes (Optional[bool]): DEPRECATED: Not supported for
|
|
6413
|
+
workfiles.
|
|
6414
|
+
|
|
6415
|
+
Returns:
|
|
6416
|
+
Generator[WorkfileInfoDict, None, None]: Queried workfile info
|
|
6417
|
+
entites.
|
|
6418
|
+
|
|
6419
|
+
"""
|
|
6420
|
+
con = get_server_api_connection()
|
|
6421
|
+
return con.get_workfiles_info(
|
|
6422
|
+
project_name=project_name,
|
|
6423
|
+
workfile_ids=workfile_ids,
|
|
6424
|
+
task_ids=task_ids,
|
|
6425
|
+
paths=paths,
|
|
6426
|
+
path_regex=path_regex,
|
|
6427
|
+
statuses=statuses,
|
|
6428
|
+
tags=tags,
|
|
6429
|
+
has_links=has_links,
|
|
6430
|
+
fields=fields,
|
|
6431
|
+
own_attributes=own_attributes,
|
|
6432
|
+
)
|
|
6433
|
+
|
|
6434
|
+
|
|
6435
|
+
def get_workfile_info(
|
|
6436
|
+
project_name: str,
|
|
6437
|
+
task_id: str,
|
|
6438
|
+
path: str,
|
|
6439
|
+
fields: Optional[Iterable[str]] = None,
|
|
6440
|
+
own_attributes=_PLACEHOLDER,
|
|
6441
|
+
) -> Optional[WorkfileInfoDict]:
|
|
6442
|
+
"""DEPRECATED Workfile info entity by task id and workfile path.
|
|
6443
|
+
|
|
6444
|
+
Args:
|
|
6445
|
+
project_name (str): Project under which the entity is located.
|
|
6446
|
+
task_id (str): Task id.
|
|
6447
|
+
path (str): Rootless workfile path.
|
|
6448
|
+
fields (Optional[Iterable[str]]): Fields to be queried for
|
|
6449
|
+
representation. All possible fields are returned if 'None' is
|
|
6450
|
+
passed.
|
|
6451
|
+
own_attributes (Optional[bool]): DEPRECATED: Not supported for
|
|
6452
|
+
workfiles.
|
|
6453
|
+
|
|
6454
|
+
Returns:
|
|
6455
|
+
Optional[WorkfileInfoDict]: Workfile info entity or None.
|
|
6456
|
+
|
|
6457
|
+
"""
|
|
6458
|
+
con = get_server_api_connection()
|
|
6459
|
+
return con.get_workfile_info(
|
|
6460
|
+
project_name=project_name,
|
|
6461
|
+
task_id=task_id,
|
|
6462
|
+
path=path,
|
|
6463
|
+
fields=fields,
|
|
6464
|
+
own_attributes=own_attributes,
|
|
6465
|
+
)
|
|
6466
|
+
|
|
6467
|
+
|
|
6468
|
+
def get_workfile_info_by_id(
|
|
6469
|
+
project_name: str,
|
|
6470
|
+
workfile_id: str,
|
|
6471
|
+
fields: Optional[Iterable[str]] = None,
|
|
6472
|
+
own_attributes=_PLACEHOLDER,
|
|
6473
|
+
) -> Optional[WorkfileInfoDict]:
|
|
6474
|
+
"""DEPRECATED Workfile info entity by id.
|
|
6475
|
+
|
|
6476
|
+
Args:
|
|
6477
|
+
project_name (str): Project under which the entity is located.
|
|
6478
|
+
workfile_id (str): Workfile info id.
|
|
6479
|
+
fields (Optional[Iterable[str]]): Fields to be queried for
|
|
6480
|
+
representation. All possible fields are returned if 'None' is
|
|
6481
|
+
passed.
|
|
6482
|
+
own_attributes (Optional[bool]): DEPRECATED: Not supported for
|
|
6483
|
+
workfiles.
|
|
6484
|
+
|
|
6485
|
+
Returns:
|
|
6486
|
+
Optional[WorkfileInfoDict]: Workfile info entity or None.
|
|
6487
|
+
|
|
6488
|
+
"""
|
|
6489
|
+
con = get_server_api_connection()
|
|
6490
|
+
return con.get_workfile_info_by_id(
|
|
6491
|
+
project_name=project_name,
|
|
6492
|
+
workfile_id=workfile_id,
|
|
6493
|
+
fields=fields,
|
|
6494
|
+
own_attributes=own_attributes,
|
|
6495
|
+
)
|
|
6496
|
+
|
|
6497
|
+
|
|
6218
6498
|
def update_workfile_info(
|
|
6219
6499
|
project_name: str,
|
|
6220
6500
|
workfile_id: str,
|
|
@@ -6229,7 +6509,7 @@ def update_workfile_info(
|
|
|
6229
6509
|
created_by: Optional[str] = None,
|
|
6230
6510
|
updated_by: Optional[str] = None,
|
|
6231
6511
|
) -> None:
|
|
6232
|
-
"""Update workfile entity on server.
|
|
6512
|
+
"""DEPRECATED Update workfile entity on server.
|
|
6233
6513
|
|
|
6234
6514
|
Update of ``attrib`` does change only passed attributes. If you want
|
|
6235
6515
|
to unset value, use ``None``.
|
|
@@ -6266,6 +6546,24 @@ def update_workfile_info(
|
|
|
6266
6546
|
)
|
|
6267
6547
|
|
|
6268
6548
|
|
|
6549
|
+
def delete_workfile_info(
|
|
6550
|
+
project_name: str,
|
|
6551
|
+
workfile_id: str,
|
|
6552
|
+
) -> None:
|
|
6553
|
+
"""DEPRECATED Delete workfile entity on server.
|
|
6554
|
+
|
|
6555
|
+
Args:
|
|
6556
|
+
project_name (str): Project name.
|
|
6557
|
+
workfile_id (str): Workfile id to delete.
|
|
6558
|
+
|
|
6559
|
+
"""
|
|
6560
|
+
con = get_server_api_connection()
|
|
6561
|
+
return con.delete_workfile_info(
|
|
6562
|
+
project_name=project_name,
|
|
6563
|
+
workfile_id=workfile_id,
|
|
6564
|
+
)
|
|
6565
|
+
|
|
6566
|
+
|
|
6269
6567
|
def get_full_link_type_name(
|
|
6270
6568
|
link_type_name: str,
|
|
6271
6569
|
input_type: str,
|
|
@@ -109,6 +109,11 @@ class BaseServerAPI:
|
|
|
109
109
|
) -> Optional[ProjectDict]:
|
|
110
110
|
raise NotImplementedError()
|
|
111
111
|
|
|
112
|
+
def get_user(
|
|
113
|
+
self, username: Optional[str] = None
|
|
114
|
+
) -> Optional[dict[str, Any]]:
|
|
115
|
+
raise NotImplementedError()
|
|
116
|
+
|
|
112
117
|
def _prepare_fields(
|
|
113
118
|
self,
|
|
114
119
|
entity_type: str,
|