Skip to content

Commit 5bc4ac9

Browse files
authored
Merge pull request #301 from ynput/enhancement/add-data-to-create-link
Links: Allow to add 'data' to a link
2 parents 5779dbc + 9614c4c commit 5bc4ac9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ayon_api/_api_helpers/links.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def create_link(
203203
output_id: str,
204204
output_type: str,
205205
link_name: Optional[str] = None,
206+
data: Optional[dict[str, Any]] = None,
206207
) -> CreateLinkData:
207208
"""Create link between 2 entities.
208209
@@ -222,7 +223,8 @@ def create_link(
222223
output_id (str): Output entity id.
223224
output_type (str): Entity type of output entity.
224225
link_name (Optional[str]): Name of link.
225-
Available from server version '1.0.0-rc.6'.
226+
data (Optional[dict[str, Any]]): Additional data to be stored
227+
with the link.
226228
227229
Returns:
228230
CreateLinkData: Information about link.
@@ -242,6 +244,9 @@ def create_link(
242244
if link_name:
243245
kwargs["name"] = link_name
244246

247+
if data:
248+
kwargs["data"] = data
249+
245250
response = self.post(
246251
f"projects/{project_name}/links", **kwargs
247252
)

0 commit comments

Comments
 (0)