From ec847d8d371366d4c7354a933475f7b12bd2bfcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Mon, 16 Dec 2024 16:56:28 +0100 Subject: [PATCH 01/13] :art: add support for representation traits --- ayon_api/_api.py | 7 +++++++ ayon_api/server_api.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ayon_api/_api.py b/ayon_api/_api.py index 3b9fc9823..1fc623d20 100644 --- a/ayon_api/_api.py +++ b/ayon_api/_api.py @@ -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. @@ -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. @@ -5508,6 +5511,7 @@ def create_representation( status=status, active=active, representation_id=representation_id, + traits=traits, ) @@ -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. @@ -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() @@ -5556,6 +5562,7 @@ def update_representation( tags=tags, status=status, active=active, + traits=traits, ) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index b6ede5e73..685579e4a 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -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. @@ -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. @@ -7532,6 +7535,7 @@ def create_representation( ("tags", tags), ("status", status), ("active", active), + ("traits", traits), ): if value is not None: create_data[key] = value @@ -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. @@ -7587,6 +7592,7 @@ def update_representation( ("tags", tags), ("status", status), ("active", active), + ("traits", traits), ): if value is not None: update_data[key] = value From f7c397cc8eb18cb3fe03d271a0f98f4ae8684f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Fri, 28 Mar 2025 18:39:21 +0100 Subject: [PATCH 02/13] =?UTF-8?q?=E2=9C=A8=20add=20traits=20to=20represent?= =?UTF-8?q?ation=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add traits as the default field for the representation --- ayon_api/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ayon_api/constants.py b/ayon_api/constants.py index 4d5700ce9..93ff2877f 100644 --- a/ayon_api/constants.py +++ b/ayon_api/constants.py @@ -131,6 +131,7 @@ "data", "status", "tags", + "traits", } REPRESENTATION_FILES_FIELDS = { From d0f560df79f4649be0b4db6d2c056bee0f436a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Mon, 7 Apr 2025 14:56:36 +0200 Subject: [PATCH 03/13] :recycle: remove traits from default fields this is to maintain compatibility with older server versions --- ayon_api/constants.py | 1 - ayon_api/server_api.py | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ayon_api/constants.py b/ayon_api/constants.py index 93ff2877f..4d5700ce9 100644 --- a/ayon_api/constants.py +++ b/ayon_api/constants.py @@ -131,7 +131,6 @@ "data", "status", "tags", - "traits", } REPRESENTATION_FILES_FIELDS = { diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 93edfc246..be1be2518 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -521,6 +521,7 @@ def __init__( self._server_version_tuple = None self._graphql_allows_data_in_query = None + self._grahql_allows_traits_in_representations = None self._session = None @@ -1116,6 +1117,20 @@ def graphql_allows_data_in_query(self) -> bool: self._graphql_allows_data_in_query = graphql_allows_data_in_query return self._graphql_allows_data_in_query + + @property + def grahql_allows_traits_in_representations(self) -> bool: + """Check server support for representation traits.""" + if self._grahql_allows_traits_in_representations is None: + major, minor, patch, _, _ = self.server_version_tuple + grahql_allows_traits_in_representations = True + if (major, minor, patch) < (1, 7, 5): + grahql_allows_traits_in_representations = False + self._grahql_allows_traits_in_representations = \ + grahql_allows_traits_in_representations + return self._grahql_allows_traits_in_representations + + def _get_user_info(self) -> Optional[Dict[str, Any]]: if self._access_token is None: return None @@ -2761,6 +2776,9 @@ def get_default_fields_for_type(self, entity_type: str) -> Set[str]: if not self.graphql_allows_data_in_query: entity_type_defaults.discard("data") + if not self.grahql_allows_traits_in_representations: + entity_type_defaults.discard("traits") + elif entity_type == "folderType": entity_type_defaults = set(DEFAULT_FOLDER_TYPE_FIELDS) From 71df6831173b4f5e3260b5599972339a6702646e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 9 Apr 2025 11:10:03 +0200 Subject: [PATCH 04/13] :sparkles: add traits to operations --- ayon_api/operations.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ayon_api/operations.py b/ayon_api/operations.py index 04fe8714d..701cf86e8 100644 --- a/ayon_api/operations.py +++ b/ayon_api/operations.py @@ -276,7 +276,8 @@ def new_representation_entity( tags=None, attribs=None, data=None, - entity_id=None + entity_id=None, + traits=None, ): """Create skeleton data of representation entity. @@ -292,6 +293,8 @@ def new_representation_entity( data (Optional[Dict[str, Any]]): Representation entity data. entity_id (Optional[str]): Predefined id of entity. New id is created if not passed. + traits (Optional[Dict[str, Any]]): Representation traits. Empty + if not passed. Returns: Dict[str, Any]: Skeleton of representation entity. @@ -309,7 +312,8 @@ def new_representation_entity( "files": files, "name": name, "data": data, - "attrib": attribs + "attrib": attribs, + "traits": traits or {}, } if tags: output["tags"] = tags @@ -1360,6 +1364,7 @@ def create_representation( status=None, active=None, representation_id=None, + traits=None, ): """Create new representation. @@ -1375,6 +1380,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. Empty + if not passed. Returns: CreateOperation: Object of create operation. @@ -1394,6 +1401,7 @@ def create_representation( ("tags", tags), ("status", status), ("active", active), + ("traits", traits), ): if value is not None: create_data[key] = value @@ -1416,6 +1424,7 @@ def update_representation( tags=None, status=None, active=None, + traits=None, ): """Update representation entity on server. @@ -1436,6 +1445,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 representation traits. Returns: UpdateOperation: Object of update operation. @@ -1451,6 +1461,7 @@ def update_representation( ("tags", tags), ("status", status), ("active", active), + ("traits", traits), ): if value is not None: update_data[key] = value From 891f637fc3b42582f7feca3f8ef9a95849bd693c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 9 Apr 2025 11:10:31 +0200 Subject: [PATCH 05/13] :bug: fix type error --- ayon_api/server_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index be1be2518..5c5d558e9 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -521,7 +521,7 @@ def __init__( self._server_version_tuple = None self._graphql_allows_data_in_query = None - self._grahql_allows_traits_in_representations = None + self._grahql_allows_traits_in_representations: Optional[bool] = None self._session = None From 93a8c376525366e94e52705f06ccd722d0956f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 9 Apr 2025 11:10:45 +0200 Subject: [PATCH 06/13] :memo: add todo for future --- ayon_api/constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ayon_api/constants.py b/ayon_api/constants.py index 4d5700ce9..9fd0f990a 100644 --- a/ayon_api/constants.py +++ b/ayon_api/constants.py @@ -131,6 +131,8 @@ "data", "status", "tags", + # TODO (antirotor): traits should be there in time when server + # usage prior to 1.7.5 is not supported (used) anymore. } REPRESENTATION_FILES_FIELDS = { From f17c8081d4df524a632f69a73e42c86374ef0e46 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:23:04 +0200 Subject: [PATCH 07/13] change order of traits argument --- ayon_api/operations.py | 20 ++++++++++---------- ayon_api/server_api.py | 13 +++++++------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ayon_api/operations.py b/ayon_api/operations.py index 701cf86e8..a77208df4 100644 --- a/ayon_api/operations.py +++ b/ayon_api/operations.py @@ -276,8 +276,8 @@ def new_representation_entity( tags=None, attribs=None, data=None, - entity_id=None, traits=None, + entity_id=None, ): """Create skeleton data of representation entity. @@ -291,10 +291,10 @@ def new_representation_entity( attribs (Optional[Dict[str, Any]]): Explicitly set attributes of representation. data (Optional[Dict[str, Any]]): Representation entity data. - entity_id (Optional[str]): Predefined id of entity. New id is created - if not passed. traits (Optional[Dict[str, Any]]): Representation traits. Empty if not passed. + entity_id (Optional[str]): Predefined id of entity. New id is created + if not passed. Returns: Dict[str, Any]: Skeleton of representation entity. @@ -1361,10 +1361,10 @@ def create_representation( attrib=None, data=None, tags=None, + traits=None, status=None, active=None, representation_id=None, - traits=None, ): """Create new representation. @@ -1376,12 +1376,12 @@ def create_representation( attrib (Optional[dict[str, Any]]): Representation attributes. data (Optional[dict[str, Any]]): Representation data. tags (Optional[Iterable[str]]): Representation tags. + traits (Optional[Dict[str, Any]]): Representation traits. Empty + if not passed. status (Optional[str]): Representation status. 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. Empty - if not passed. Returns: CreateOperation: Object of create operation. @@ -1399,9 +1399,9 @@ def create_representation( ("attrib", attrib), ("data", data), ("tags", tags), + ("traits", traits), ("status", status), ("active", active), - ("traits", traits), ): if value is not None: create_data[key] = value @@ -1422,9 +1422,9 @@ def update_representation( attrib=None, data=None, tags=None, + traits=None, status=None, active=None, - traits=None, ): """Update representation entity on server. @@ -1443,9 +1443,9 @@ def update_representation( attrib (Optional[dict[str, Any]]): New attributes. data (Optional[dict[str, Any]]): New data. tags (Optional[Iterable[str]]): New tags. + traits (Optional[Dict[str, Any]]): New representation traits. status (Optional[str]): New status. active (Optional[bool]): New active state. - traits (Optional[Dict[str, Any]]): New representation traits. Returns: UpdateOperation: Object of update operation. @@ -1459,9 +1459,9 @@ def update_representation( ("attrib", attrib), ("data", data), ("tags", tags), + ("traits", traits), ("status", status), ("active", active), - ("traits", traits), ): if value is not None: update_data[key] = value diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index e6034ec75..6b3d293cb 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -7471,10 +7471,10 @@ def create_representation( attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, tags: Optional[List[str]]=None, + traits: Optional[Dict[str, Any]] = None, status: Optional[str] = None, active: Optional[bool] = None, representation_id: Optional[str] = None, - traits: Optional[Dict[str, Any]] = None, ) -> str: """Create new representation. @@ -7486,12 +7486,12 @@ def create_representation( attrib (Optional[dict[str, Any]]): Representation attributes. data (Optional[dict[str, Any]]): Representation data. tags (Optional[Iterable[str]]): Representation tags. + traits (Optional[dict[str, Any]]): Representation traits + serialized data as dict. status (Optional[str]): Representation status. 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. @@ -7508,10 +7508,10 @@ def create_representation( ("files", files), ("attrib", attrib), ("data", data), + ("traits", traits), ("tags", tags), ("status", status), ("active", active), - ("traits", traits), ): if value is not None: create_data[key] = value @@ -7533,9 +7533,9 @@ def update_representation( attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, tags: Optional[List[str]] = None, + traits: Optional[Dict[str, Any]] = None, status: Optional[str] = None, active: Optional[bool] = None, - traits: Optional[Dict[str, Any]] = None, ): """Update representation entity on server. @@ -7554,6 +7554,7 @@ def update_representation( attrib (Optional[dict[str, Any]]): New attributes. data (Optional[dict[str, Any]]): New data. tags (Optional[Iterable[str]]): New tags. + traits (Optional[dict[str, Any]]): New traits. status (Optional[str]): New status. active (Optional[bool]): New active state. @@ -7566,9 +7567,9 @@ def update_representation( ("attrib", attrib), ("data", data), ("tags", tags), + ("traits", traits), ("status", status), ("active", active), - ("traits", traits), ): if value is not None: update_data[key] = value From adb3f8583d3fc12c1fb5dc623d2a694b047b3245 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:23:17 +0200 Subject: [PATCH 08/13] don't add traits if are empty --- ayon_api/operations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ayon_api/operations.py b/ayon_api/operations.py index a77208df4..f0572cdb2 100644 --- a/ayon_api/operations.py +++ b/ayon_api/operations.py @@ -313,10 +313,11 @@ def new_representation_entity( "name": name, "data": data, "attrib": attribs, - "traits": traits or {}, } if tags: output["tags"] = tags + if traits: + output["traits"] = traits if status: output["status"] = status return output From 24f279181a06654f7488d78bfa8ceb7bb7e59400 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:23:32 +0200 Subject: [PATCH 09/13] rename 'grahql_allows_traits_in_representations' to 'representation_traits_available' --- ayon_api/server_api.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 6b3d293cb..3bc699c37 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -521,7 +521,7 @@ def __init__( self._server_version_tuple = None self._graphql_allows_data_in_query = None - self._grahql_allows_traits_in_representations: Optional[bool] = None + self._representation_traits_available: Optional[bool] = None self._session = None @@ -1119,16 +1119,14 @@ def graphql_allows_data_in_query(self) -> bool: @property - def grahql_allows_traits_in_representations(self) -> bool: + def representation_traits_available(self) -> bool: """Check server support for representation traits.""" - if self._grahql_allows_traits_in_representations is None: + if self._representation_traits_available is None: major, minor, patch, _, _ = self.server_version_tuple - grahql_allows_traits_in_representations = True - if (major, minor, patch) < (1, 7, 5): - grahql_allows_traits_in_representations = False - self._grahql_allows_traits_in_representations = \ - grahql_allows_traits_in_representations - return self._grahql_allows_traits_in_representations + self._representation_traits_available = ( + (major, minor, patch) >= (1, 7, 5) + ) + return self._representation_traits_available def _get_user_info(self) -> Optional[Dict[str, Any]]: @@ -2776,7 +2774,7 @@ def get_default_fields_for_type(self, entity_type: str) -> Set[str]: if not self.graphql_allows_data_in_query: entity_type_defaults.discard("data") - if not self.grahql_allows_traits_in_representations: + if not self.representation_traits_available: entity_type_defaults.discard("traits") elif entity_type == "folderType": From 018dcd429db656833eb32c49fa7f9f28d5eaca2a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 14 Apr 2025 09:23:32 +0200 Subject: [PATCH 10/13] actually add traits to repre fields --- ayon_api/constants.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ayon_api/constants.py b/ayon_api/constants.py index 9fd0f990a..93ff2877f 100644 --- a/ayon_api/constants.py +++ b/ayon_api/constants.py @@ -131,8 +131,7 @@ "data", "status", "tags", - # TODO (antirotor): traits should be there in time when server - # usage prior to 1.7.5 is not supported (used) anymore. + "traits", } REPRESENTATION_FILES_FIELDS = { From a3cd06c9873ba4123b2c0ff7ab0bb79259a6d17b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 14 Apr 2025 09:23:46 +0200 Subject: [PATCH 11/13] reverse to 'graphql_allows_traits_in_representations' --- ayon_api/server_api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 3bc699c37..eafff10e7 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -521,7 +521,7 @@ def __init__( self._server_version_tuple = None self._graphql_allows_data_in_query = None - self._representation_traits_available: Optional[bool] = None + self._graphql_allows_traits_in_representations: Optional[bool] = None self._session = None @@ -1119,14 +1119,14 @@ def graphql_allows_data_in_query(self) -> bool: @property - def representation_traits_available(self) -> bool: + def graphql_allows_traits_in_representations(self) -> bool: """Check server support for representation traits.""" - if self._representation_traits_available is None: + if self._graphql_allows_traits_in_representations is None: major, minor, patch, _, _ = self.server_version_tuple - self._representation_traits_available = ( + self._graphql_allows_traits_in_representations = ( (major, minor, patch) >= (1, 7, 5) ) - return self._representation_traits_available + return self._graphql_allows_traits_in_representations def _get_user_info(self) -> Optional[Dict[str, Any]]: @@ -2774,7 +2774,7 @@ def get_default_fields_for_type(self, entity_type: str) -> Set[str]: if not self.graphql_allows_data_in_query: entity_type_defaults.discard("data") - if not self.representation_traits_available: + if not self.graphql_allows_traits_in_representations: entity_type_defaults.discard("traits") elif entity_type == "folderType": From a932482d227cac90183cec9ba58a5a3b3c27f698 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 14 Apr 2025 09:24:45 +0200 Subject: [PATCH 12/13] update public api --- ayon_api/_api.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ayon_api/_api.py b/ayon_api/_api.py index 1fc623d20..8d6715e88 100644 --- a/ayon_api/_api.py +++ b/ayon_api/_api.py @@ -5473,10 +5473,10 @@ def create_representation( attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, tags: Optional[List[str]] = None, + traits: Optional[Dict[str, Any]] = None, status: Optional[str] = None, active: Optional[bool] = None, representation_id: Optional[str] = None, - traits: Optional[Dict[str, Any]] = None, ) -> str: """Create new representation. @@ -5488,12 +5488,12 @@ def create_representation( attrib (Optional[dict[str, Any]]): Representation attributes. data (Optional[dict[str, Any]]): Representation data. tags (Optional[Iterable[str]]): Representation tags. + traits (Optional[dict[str, Any]]): Representation traits + serialized data as dict. status (Optional[str]): Representation status. 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. @@ -5508,10 +5508,10 @@ def create_representation( attrib=attrib, data=data, tags=tags, + traits=traits, status=status, active=active, representation_id=representation_id, - traits=traits, ) @@ -5524,9 +5524,9 @@ def update_representation( attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, tags: Optional[List[str]] = None, + traits: Optional[Dict[str, Any]] = None, status: Optional[str] = None, active: Optional[bool] = None, - traits: Optional[Dict[str, Any]] = None, ): """Update representation entity on server. @@ -5545,9 +5545,9 @@ def update_representation( attrib (Optional[dict[str, Any]]): New attributes. data (Optional[dict[str, Any]]): New data. tags (Optional[Iterable[str]]): New tags. + traits (Optional[dict[str, Any]]): New traits. status (Optional[str]): New status. active (Optional[bool]): New active state. - traits (Optional[dict[str, Any]]): New traits. """ con = get_server_api_connection() @@ -5560,9 +5560,9 @@ def update_representation( attrib=attrib, data=data, tags=tags, + traits=traits, status=status, active=active, - traits=traits, ) From a919f7c7341ad48f29c740d2cd50b63c48904fbc Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 14 Apr 2025 09:30:02 +0200 Subject: [PATCH 13/13] move the 'traits' after 'data' --- ayon_api/_api.py | 12 ++++++------ ayon_api/operations.py | 16 ++++++++-------- ayon_api/server_api.py | 10 +++++----- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ayon_api/_api.py b/ayon_api/_api.py index 8d6715e88..ca78be03d 100644 --- a/ayon_api/_api.py +++ b/ayon_api/_api.py @@ -5472,8 +5472,8 @@ def create_representation( files: Optional[List[Dict[str, Any]]] = None, attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, - tags: Optional[List[str]] = None, traits: Optional[Dict[str, Any]] = None, + tags: Optional[List[str]] = None, status: Optional[str] = None, active: Optional[bool] = None, representation_id: Optional[str] = None, @@ -5487,9 +5487,9 @@ def create_representation( files (Optional[list[dict]]): Representation files information. attrib (Optional[dict[str, Any]]): Representation attributes. data (Optional[dict[str, Any]]): Representation data. - tags (Optional[Iterable[str]]): Representation tags. traits (Optional[dict[str, Any]]): Representation traits serialized data as dict. + tags (Optional[Iterable[str]]): Representation tags. status (Optional[str]): Representation status. active (Optional[bool]): Representation active state. representation_id (Optional[str]): Representation id. If not @@ -5507,8 +5507,8 @@ def create_representation( files=files, attrib=attrib, data=data, - tags=tags, traits=traits, + tags=tags, status=status, active=active, representation_id=representation_id, @@ -5523,8 +5523,8 @@ def update_representation( files: Optional[List[Dict[str, Any]]] = None, attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, - tags: Optional[List[str]] = None, traits: Optional[Dict[str, Any]] = None, + tags: Optional[List[str]] = None, status: Optional[str] = None, active: Optional[bool] = None, ): @@ -5544,8 +5544,8 @@ def update_representation( information. attrib (Optional[dict[str, Any]]): New attributes. data (Optional[dict[str, Any]]): New data. - tags (Optional[Iterable[str]]): New tags. traits (Optional[dict[str, Any]]): New traits. + tags (Optional[Iterable[str]]): New tags. status (Optional[str]): New status. active (Optional[bool]): New active state. @@ -5559,8 +5559,8 @@ def update_representation( files=files, attrib=attrib, data=data, - tags=tags, traits=traits, + tags=tags, status=status, active=active, ) diff --git a/ayon_api/operations.py b/ayon_api/operations.py index 0e3db357c..d4383fda1 100644 --- a/ayon_api/operations.py +++ b/ayon_api/operations.py @@ -314,10 +314,10 @@ def new_representation_entity( "data": data, "attrib": attribs, } - if tags: - output["tags"] = tags if traits: output["traits"] = traits + if tags: + output["tags"] = tags if status: output["status"] = status return output @@ -1364,8 +1364,8 @@ def create_representation( files=None, attrib=None, data=None, - tags=None, traits=None, + tags=None, status=None, active=None, representation_id=None, @@ -1379,9 +1379,9 @@ def create_representation( files (Optional[list[dict]]): Representation files information. attrib (Optional[dict[str, Any]]): Representation attributes. data (Optional[dict[str, Any]]): Representation data. - tags (Optional[Iterable[str]]): Representation tags. traits (Optional[Dict[str, Any]]): Representation traits. Empty if not passed. + tags (Optional[Iterable[str]]): Representation tags. status (Optional[str]): Representation status. active (Optional[bool]): Representation active state. representation_id (Optional[str]): Representation id. If not @@ -1402,8 +1402,8 @@ def create_representation( ("files", files), ("attrib", attrib), ("data", data), - ("tags", tags), ("traits", traits), + ("tags", tags), ("status", status), ("active", active), ): @@ -1425,8 +1425,8 @@ def update_representation( files=None, attrib=None, data=None, - tags=None, traits=None, + tags=None, status=None, active=None, ): @@ -1446,8 +1446,8 @@ def update_representation( information. attrib (Optional[dict[str, Any]]): New attributes. data (Optional[dict[str, Any]]): New data. - tags (Optional[Iterable[str]]): New tags. traits (Optional[Dict[str, Any]]): New representation traits. + tags (Optional[Iterable[str]]): New tags. status (Optional[str]): New status. active (Optional[bool]): New active state. @@ -1462,8 +1462,8 @@ def update_representation( ("files", files), ("attrib", attrib), ("data", data), - ("tags", tags), ("traits", traits), + ("tags", tags), ("status", status), ("active", active), ): diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index fb08ad520..e15ee5d5b 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -7472,8 +7472,8 @@ def create_representation( files: Optional[List[Dict[str, Any]]] = None, attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, - tags: Optional[List[str]]=None, traits: Optional[Dict[str, Any]] = None, + tags: Optional[List[str]]=None, status: Optional[str] = None, active: Optional[bool] = None, representation_id: Optional[str] = None, @@ -7487,9 +7487,9 @@ def create_representation( files (Optional[list[dict]]): Representation files information. attrib (Optional[dict[str, Any]]): Representation attributes. data (Optional[dict[str, Any]]): Representation data. - tags (Optional[Iterable[str]]): Representation tags. traits (Optional[dict[str, Any]]): Representation traits serialized data as dict. + tags (Optional[Iterable[str]]): Representation tags. status (Optional[str]): Representation status. active (Optional[bool]): Representation active state. representation_id (Optional[str]): Representation id. If not @@ -7534,8 +7534,8 @@ def update_representation( files: Optional[List[Dict[str, Any]]] = None, attrib: Optional[Dict[str, Any]] = None, data: Optional[Dict[str, Any]] = None, - tags: Optional[List[str]] = None, traits: Optional[Dict[str, Any]] = None, + tags: Optional[List[str]] = None, status: Optional[str] = None, active: Optional[bool] = None, ): @@ -7555,8 +7555,8 @@ def update_representation( information. attrib (Optional[dict[str, Any]]): New attributes. data (Optional[dict[str, Any]]): New data. - tags (Optional[Iterable[str]]): New tags. traits (Optional[dict[str, Any]]): New traits. + tags (Optional[Iterable[str]]): New tags. status (Optional[str]): New status. active (Optional[bool]): New active state. @@ -7568,8 +7568,8 @@ def update_representation( ("files", files), ("attrib", attrib), ("data", data), - ("tags", tags), ("traits", traits), + ("tags", tags), ("status", status), ("active", active), ):