@@ -1389,6 +1389,26 @@ def serialize_body(body):
13891389 "parent_id" : body .parent_id ,
13901390 "is_surface" : body .is_surface ,
13911391 }
1392+
1393+ def serialize_component (component ):
1394+ return {
1395+ "id" : component .id ,
1396+
1397+ "can_suppress" : component .can_suppress ,
1398+ "transform_to_master" : {
1399+ "m00" : component .transform_to_master .m00 ,
1400+ "m11" : component .transform_to_master .m11 ,
1401+ "m22" : component .transform_to_master .m22 ,
1402+ "m33" : component .transform_to_master .m33 ,
1403+ },
1404+ "master_id" : component .master_id ,
1405+ "parent_id" : component .parent_id ,
1406+ }
1407+
1408+ def serialize_part (part ):
1409+ return {
1410+ "id" : part .id ,
1411+ }
13921412
13931413 def serialize_entity_identifier (entity ):
13941414 """Serialize an EntityIdentifier object into a dictionary."""
@@ -1399,14 +1419,34 @@ def serialize_entity_identifier(entity):
13991419 response = kwargs ["response" ]
14001420 return {
14011421 "success" : response .success ,
1422+
1423+ "created_parts" : [
1424+ serialize_part (part ) for part in getattr (response , "created_parts" , [])
1425+ ],
1426+ "modified_parts" : [
1427+ serialize_part (part ) for part in getattr (response , "modified_parts" , [])
1428+ ],
1429+ "deleted_parts" : [
1430+ serialize_entity_identifier (entity ) for entity in getattr (response , "deleted_parts" , [])
1431+ ],
1432+ "created_components" : [
1433+ serialize_component (component ) for component in getattr (response , "created_components" , [])
1434+ ],
1435+ "modified_components" : [
1436+ serialize_component (component ) for component in getattr (response , "modified_components" , [])
1437+ ],
1438+ "deleted_components" : [
1439+ serialize_entity_identifier (entity )
1440+ for entity in getattr (response , "deleted_components" , [])
1441+ ],
1442+
14021443 "created_bodies" : [
14031444 serialize_body (body ) for body in getattr (response , "created_bodies" , [])
14041445 ],
14051446 "modified_bodies" : [
14061447 serialize_body (body ) for body in getattr (response , "modified_bodies" , [])
14071448 ],
14081449 "deleted_bodies" : [
1409- serialize_entity_identifier (entity )
1410- for entity in getattr (response , "deleted_bodies" , [])
1450+ serialize_entity_identifier (entity ) for entity in getattr (response , "deleted_bodies" , [])
14111451 ],
14121452 }
0 commit comments