Skip to content

Commit dc40920

Browse files
committed
add public function
1 parent 3d15f41 commit dc40920

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

ayon_api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
get_workfiles_info,
224224
get_workfile_info,
225225
get_workfile_info_by_id,
226+
create_workfile_info,
226227
delete_workfile_info,
227228
update_workfile_info,
228229
get_full_link_type_name,
@@ -490,6 +491,7 @@
490491
"get_workfiles_info",
491492
"get_workfile_info",
492493
"get_workfile_info_by_id",
494+
"create_workfile_info",
493495
"delete_workfile_info",
494496
"update_workfile_info",
495497
"get_full_link_type_name",

ayon_api/_api.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6197,6 +6197,53 @@ def get_workfile_info_by_id(
61976197
)
61986198

61996199

6200+
def create_workfile_info(
6201+
project_name: str,
6202+
path: str,
6203+
task_id: str,
6204+
*,
6205+
thumbnail_id: Optional[str] = None,
6206+
attrib: Optional[dict[str, Any]] = None,
6207+
data: Optional[dict[str, Any]] = None,
6208+
tags: Optional[list[str]] = None,
6209+
status: Optional[str] = None,
6210+
active: Optional[bool] = None,
6211+
workfile_id: Optional[str] = None,
6212+
) -> str:
6213+
"""Create new workfile.
6214+
6215+
Args:
6216+
project_name (str): Project name.
6217+
path (str): Representation name.
6218+
task_id (str): Parent task id.
6219+
thumbnail_id (Optional[str]): Thumbnail id.
6220+
attrib (Optional[dict[str, Any]]): Representation attributes.
6221+
data (Optional[dict[str, Any]]): Representation data.
6222+
tags (Optional[Iterable[str]]): Representation tags.
6223+
status (Optional[str]): Representation status.
6224+
active (Optional[bool]): Representation active state.
6225+
workfile_id (Optional[str]): Workfile info id. If not
6226+
passed new id is generated.
6227+
6228+
Returns:
6229+
str: Workfile info id.
6230+
6231+
"""
6232+
con = get_server_api_connection()
6233+
return con.create_workfile_info(
6234+
project_name=project_name,
6235+
path=path,
6236+
task_id=task_id,
6237+
thumbnail_id=thumbnail_id,
6238+
attrib=attrib,
6239+
data=data,
6240+
tags=tags,
6241+
status=status,
6242+
active=active,
6243+
workfile_id=workfile_id,
6244+
)
6245+
6246+
62006247
def delete_workfile_info(
62016248
project_name: str,
62026249
workfile_id: str,

0 commit comments

Comments
 (0)