Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for representation traits #225

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ayon_api/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5476,6 +5476,7 @@ def create_representation(
status: Optional[str] = None,
active: Optional[bool] = None,
representation_id: Optional[str] = None,
traits: Optional[Dict[str, Any]] = None,
) -> str:
"""Create new representation.

Expand All @@ -5491,6 +5492,8 @@ def create_representation(
active (Optional[bool]): Representation active state.
representation_id (Optional[str]): Representation id. If not
passed new id is generated.
traits (Optional[dict[str, Any]]): Representation traits
serialized as dict.

Returns:
str: Representation id.
Expand All @@ -5508,6 +5511,7 @@ def create_representation(
status=status,
active=active,
representation_id=representation_id,
traits=traits,
)


Expand All @@ -5522,6 +5526,7 @@ def update_representation(
tags: Optional[List[str]] = None,
status: Optional[str] = None,
active: Optional[bool] = None,
traits: Optional[Dict[str, Any]] = None,
):
"""Update representation entity on server.

Expand All @@ -5542,6 +5547,7 @@ def update_representation(
tags (Optional[Iterable[str]]): New tags.
status (Optional[str]): New status.
active (Optional[bool]): New active state.
traits (Optional[dict[str, Any]]): New traits.

"""
con = get_server_api_connection()
Expand All @@ -5556,6 +5562,7 @@ def update_representation(
tags=tags,
status=status,
active=active,
traits=traits,
)


Expand Down
6 changes: 6 additions & 0 deletions ayon_api/server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7498,6 +7498,7 @@ def create_representation(
status: Optional[str] = None,
active: Optional[bool] = None,
representation_id: Optional[str] = None,
traits: Optional[Dict[str, Any]] = None,
) -> str:
"""Create new representation.

Expand All @@ -7513,6 +7514,8 @@ def create_representation(
active (Optional[bool]): Representation active state.
representation_id (Optional[str]): Representation id. If not
passed new id is generated.
traits (Optional[dict[str, Any]]): Representation traits
serialized data as dict.

Returns:
str: Representation id.
Expand All @@ -7532,6 +7535,7 @@ def create_representation(
("tags", tags),
("status", status),
("active", active),
("traits", traits),
):
if value is not None:
create_data[key] = value
Expand All @@ -7555,6 +7559,7 @@ def update_representation(
tags: Optional[List[str]] = None,
status: Optional[str] = None,
active: Optional[bool] = None,
traits: Optional[Dict[str, Any]] = None,
):
"""Update representation entity on server.

Expand Down Expand Up @@ -7587,6 +7592,7 @@ def update_representation(
("tags", tags),
("status", status),
("active", active),
("traits", traits),
):
if value is not None:
update_data[key] = value
Expand Down
Loading