Skip to content

Commit 87bfe2f

Browse files
committed
MINOR: labeling API on JPEG, PNG & PDF model (#870)
* Add basic labels. * WIP: label route for worker. * Add label retrieving at the org level. * Rename BCF Label view to avoid swagger warning about conflict * Add test for malicious requests on label routes. * Rename Model Label view & serialiser. * Rework color formating for label. * Compile the color regex. * Fix typo in help text describing color format.
1 parent 092b40f commit 87bfe2f

39 files changed

+3217
-129
lines changed

.openapi-generator/FILES

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ bimdata_api_client/configuration.py
1515
bimdata_api_client/exceptions.py
1616
bimdata_api_client/model/__init__.py
1717
bimdata_api_client/model/auth.py
18+
bimdata_api_client/model/bcf_label.py
19+
bimdata_api_client/model/bcf_label_request.py
1820
bimdata_api_client/model/bcf_project.py
1921
bimdata_api_client/model/bcf_project_request.py
2022
bimdata_api_client/model/building.py
@@ -65,6 +67,8 @@ bimdata_api_client/model/folder_without_children.py
6567
bimdata_api_client/model/folder_without_children_request.py
6668
bimdata_api_client/model/full_topic.py
6769
bimdata_api_client/model/full_topic_request.py
70+
bimdata_api_client/model/geometry2d_point.py
71+
bimdata_api_client/model/geometry2d_point_request.py
6872
bimdata_api_client/model/geometry_point.py
6973
bimdata_api_client/model/geometry_point_request.py
7074
bimdata_api_client/model/group.py
@@ -78,8 +82,6 @@ bimdata_api_client/model/ifc_merge_request.py
7882
bimdata_api_client/model/ifc_optimize_request.py
7983
bimdata_api_client/model/import_group_request.py
8084
bimdata_api_client/model/invitation.py
81-
bimdata_api_client/model/label.py
82-
bimdata_api_client/model/label_request.py
8385
bimdata_api_client/model/layer.py
8486
bimdata_api_client/model/layer_element.py
8587
bimdata_api_client/model/layer_element_request.py
@@ -104,13 +106,16 @@ bimdata_api_client/model/model_document_request.py
104106
bimdata_api_client/model/model_errors.py
105107
bimdata_api_client/model/model_errors_request.py
106108
bimdata_api_client/model/model_files.py
109+
bimdata_api_client/model/model_label.py
110+
bimdata_api_client/model/model_label_request.py
107111
bimdata_api_client/model/model_property.py
108112
bimdata_api_client/model/model_serializer_without_children.py
109113
bimdata_api_client/model/model_with_positioning_plan.py
110114
bimdata_api_client/model/organization.py
111115
bimdata_api_client/model/organization_request.py
112116
bimdata_api_client/model/orthogonal_camera.py
113117
bimdata_api_client/model/orthogonal_camera_request.py
118+
bimdata_api_client/model/patched_bcf_label_request.py
114119
bimdata_api_client/model/patched_bcf_project_request.py
115120
bimdata_api_client/model/patched_classification_request.py
116121
bimdata_api_client/model/patched_cloud_request.py
@@ -123,9 +128,9 @@ bimdata_api_client/model/patched_full_topic_request.py
123128
bimdata_api_client/model/patched_group_folder_request.py
124129
bimdata_api_client/model/patched_group_request.py
125130
bimdata_api_client/model/patched_ifc_access_token_request.py
126-
bimdata_api_client/model/patched_label_request.py
127131
bimdata_api_client/model/patched_layer_request.py
128132
bimdata_api_client/model/patched_mask2_d_request.py
133+
bimdata_api_client/model/patched_model_label_request.py
129134
bimdata_api_client/model/patched_model_request.py
130135
bimdata_api_client/model/patched_pin_request.py
131136
bimdata_api_client/model/patched_positioning_plan_request.py
@@ -279,6 +284,8 @@ bimdata_api_client/models/__init__.py
279284
bimdata_api_client/rest.py
280285
docs/Auth.md
281286
docs/BcfApi.md
287+
docs/BcfLabel.md
288+
docs/BcfLabelRequest.md
282289
docs/BcfProject.md
283290
docs/BcfProjectRequest.md
284291
docs/Building.md
@@ -330,6 +337,8 @@ docs/FolderWithoutChildren.md
330337
docs/FolderWithoutChildrenRequest.md
331338
docs/FullTopic.md
332339
docs/FullTopicRequest.md
340+
docs/Geometry2dPoint.md
341+
docs/Geometry2dPointRequest.md
333342
docs/GeometryPoint.md
334343
docs/GeometryPointRequest.md
335344
docs/Group.md
@@ -343,8 +352,6 @@ docs/IfcMergeRequest.md
343352
docs/IfcOptimizeRequest.md
344353
docs/ImportGroupRequest.md
345354
docs/Invitation.md
346-
docs/Label.md
347-
docs/LabelRequest.md
348355
docs/Layer.md
349356
docs/LayerElement.md
350357
docs/LayerElementRequest.md
@@ -370,13 +377,16 @@ docs/ModelDocumentRequest.md
370377
docs/ModelErrors.md
371378
docs/ModelErrorsRequest.md
372379
docs/ModelFiles.md
380+
docs/ModelLabel.md
381+
docs/ModelLabelRequest.md
373382
docs/ModelProperty.md
374383
docs/ModelSerializerWithoutChildren.md
375384
docs/ModelWithPositioningPlan.md
376385
docs/Organization.md
377386
docs/OrganizationRequest.md
378387
docs/OrthogonalCamera.md
379388
docs/OrthogonalCameraRequest.md
389+
docs/PatchedBcfLabelRequest.md
380390
docs/PatchedBcfProjectRequest.md
381391
docs/PatchedClassificationRequest.md
382392
docs/PatchedCloudRequest.md
@@ -389,9 +399,9 @@ docs/PatchedFullTopicRequest.md
389399
docs/PatchedGroupFolderRequest.md
390400
docs/PatchedGroupRequest.md
391401
docs/PatchedIfcAccessTokenRequest.md
392-
docs/PatchedLabelRequest.md
393402
docs/PatchedLayerRequest.md
394403
docs/PatchedMask2DRequest.md
404+
docs/PatchedModelLabelRequest.md
395405
docs/PatchedModelRequest.md
396406
docs/PatchedPinRequest.md
397407
docs/PatchedPositioningPlanRequest.md
@@ -548,6 +558,8 @@ test-requirements.txt
548558
test/__init__.py
549559
test/test_auth.py
550560
test/test_bcf_api.py
561+
test/test_bcf_label.py
562+
test/test_bcf_label_request.py
551563
test/test_bcf_project.py
552564
test/test_bcf_project_request.py
553565
test/test_building.py
@@ -599,6 +611,8 @@ test/test_folder_without_children.py
599611
test/test_folder_without_children_request.py
600612
test/test_full_topic.py
601613
test/test_full_topic_request.py
614+
test/test_geometry2d_point.py
615+
test/test_geometry2d_point_request.py
602616
test/test_geometry_point.py
603617
test/test_geometry_point_request.py
604618
test/test_group.py
@@ -612,8 +626,6 @@ test/test_ifc_merge_request.py
612626
test/test_ifc_optimize_request.py
613627
test/test_import_group_request.py
614628
test/test_invitation.py
615-
test/test_label.py
616-
test/test_label_request.py
617629
test/test_layer.py
618630
test/test_layer_element.py
619631
test/test_layer_element_request.py
@@ -639,13 +651,16 @@ test/test_model_document_request.py
639651
test/test_model_errors.py
640652
test/test_model_errors_request.py
641653
test/test_model_files.py
654+
test/test_model_label.py
655+
test/test_model_label_request.py
642656
test/test_model_property.py
643657
test/test_model_serializer_without_children.py
644658
test/test_model_with_positioning_plan.py
645659
test/test_organization.py
646660
test/test_organization_request.py
647661
test/test_orthogonal_camera.py
648662
test/test_orthogonal_camera_request.py
663+
test/test_patched_bcf_label_request.py
649664
test/test_patched_bcf_project_request.py
650665
test/test_patched_classification_request.py
651666
test/test_patched_cloud_request.py
@@ -658,9 +673,9 @@ test/test_patched_full_topic_request.py
658673
test/test_patched_group_folder_request.py
659674
test/test_patched_group_request.py
660675
test/test_patched_ifc_access_token_request.py
661-
test/test_patched_label_request.py
662676
test/test_patched_layer_request.py
663677
test/test_patched_mask2_d_request.py
678+
test/test_patched_model_label_request.py
664679
test/test_patched_model_request.py
665680
test/test_patched_pin_request.py
666681
test/test_patched_positioning_plan_request.py

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ import bimdata_api_client
5353
from pprint import pprint
5454
from bimdata_api_client.api import bcf_api
5555
from bimdata_api_client.model.auth import Auth
56+
from bimdata_api_client.model.bcf_label import BcfLabel
57+
from bimdata_api_client.model.bcf_label_request import BcfLabelRequest
5658
from bimdata_api_client.model.bcf_project import BcfProject
5759
from bimdata_api_client.model.bcf_project_request import BcfProjectRequest
5860
from bimdata_api_client.model.coloring_definition import ColoringDefinition
@@ -62,12 +64,10 @@ from bimdata_api_client.model.detailed_extensions import DetailedExtensions
6264
from bimdata_api_client.model.extensions import Extensions
6365
from bimdata_api_client.model.full_topic import FullTopic
6466
from bimdata_api_client.model.full_topic_request import FullTopicRequest
65-
from bimdata_api_client.model.label import Label
66-
from bimdata_api_client.model.label_request import LabelRequest
67+
from bimdata_api_client.model.patched_bcf_label_request import PatchedBcfLabelRequest
6768
from bimdata_api_client.model.patched_bcf_project_request import PatchedBcfProjectRequest
6869
from bimdata_api_client.model.patched_comment_request import PatchedCommentRequest
6970
from bimdata_api_client.model.patched_full_topic_request import PatchedFullTopicRequest
70-
from bimdata_api_client.model.patched_label_request import PatchedLabelRequest
7171
from bimdata_api_client.model.patched_pin_request import PatchedPinRequest
7272
from bimdata_api_client.model.patched_priority_request import PatchedPriorityRequest
7373
from bimdata_api_client.model.patched_stage_request import PatchedStageRequest
@@ -345,6 +345,7 @@ Class | Method | HTTP request | Description
345345
*ModelApi* | [**create_element_property_set_property**](docs/ModelApi.md#create_element_property_set_property) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property | Create a property to a PropertySet
346346
*ModelApi* | [**create_element_property_set_property_definition**](docs/ModelApi.md#create_element_property_set_property_definition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition | Create a Definition to a Property
347347
*ModelApi* | [**create_element_property_set_property_definition_unit**](docs/ModelApi.md#create_element_property_set_property_definition_unit) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{property_pk}/propertydefinition/{propertydefinition_pk}/unit | Create a Unit to a Definition
348+
*ModelApi* | [**create_label**](docs/ModelApi.md#create_label) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/label | Create a label in the model
348349
*ModelApi* | [**create_layer**](docs/ModelApi.md#create_layer) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer | Create a layer in the model
349350
*ModelApi* | [**create_mask2_d**](docs/ModelApi.md#create_mask2_d) | **PUT** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/mask-2d | Create or update a 2D mask for the model
350351
*ModelApi* | [**create_meta_building**](docs/ModelApi.md#create_meta_building) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/create-metabuilding | Create an empty 3D Model
@@ -370,6 +371,7 @@ Class | Method | HTTP request | Description
370371
*ModelApi* | [**delete_building_plan**](docs/ModelApi.md#delete_building_plan) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/building/{building_uuid}/plan/{id} | Delete the relation between a 2d model and a building
371372
*ModelApi* | [**delete_drawing**](docs/ModelApi.md#delete_drawing) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/drawing/{id} | Delete a drawing of a model
372373
*ModelApi* | [**delete_element**](docs/ModelApi.md#delete_element) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{uuid} | Delete an element of a model
374+
*ModelApi* | [**delete_label**](docs/ModelApi.md#delete_label) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/label/{id} | Delete a label
373375
*ModelApi* | [**delete_layer**](docs/ModelApi.md#delete_layer) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer/{id} | Delete a layer of a model
374376
*ModelApi* | [**delete_mask2_d**](docs/ModelApi.md#delete_mask2_d) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/mask-2d | Delete the 2D mask for the model
375377
*ModelApi* | [**delete_model**](docs/ModelApi.md#delete_model) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{id} | Delete a model
@@ -407,6 +409,8 @@ Class | Method | HTTP request | Description
407409
*ModelApi* | [**get_element_property_sets**](docs/ModelApi.md#get_element_property_sets) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset | Retrieve all PropertySets of an element
408410
*ModelApi* | [**get_elements**](docs/ModelApi.md#get_elements) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element | Retrieve all elements of a model
409411
*ModelApi* | [**get_elements_from_classification**](docs/ModelApi.md#get_elements_from_classification) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/classification/{model_classification_pk}/element | Retrieve all elements with the classification
412+
*ModelApi* | [**get_label**](docs/ModelApi.md#get_label) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/label/{id} | Retrieve one label of the model
413+
*ModelApi* | [**get_labels**](docs/ModelApi.md#get_labels) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/label | Retrieve all labels of the model
410414
*ModelApi* | [**get_layer**](docs/ModelApi.md#get_layer) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer/{id} | Retrieve a layer of a model
411415
*ModelApi* | [**get_layers**](docs/ModelApi.md#get_layers) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer | Retrieve all layers of a model
412416
*ModelApi* | [**get_material**](docs/ModelApi.md#get_material) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/material/{id} | Retrieve a material of a model
@@ -460,6 +464,7 @@ Class | Method | HTTP request | Description
460464
*ModelApi* | [**update_drawing**](docs/ModelApi.md#update_drawing) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/drawing/{id} | Update some fields of a drawing
461465
*ModelApi* | [**update_element**](docs/ModelApi.md#update_element) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{uuid} | Update some fields of an element
462466
*ModelApi* | [**update_element_property_set_property**](docs/ModelApi.md#update_element_property_set_property) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Update a property from an element
467+
*ModelApi* | [**update_label**](docs/ModelApi.md#update_label) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/label/{id} | Update some fields of a label
463468
*ModelApi* | [**update_layer**](docs/ModelApi.md#update_layer) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/layer/{id} | Update some fields of a layer
464469
*ModelApi* | [**update_mask2_d**](docs/ModelApi.md#update_mask2_d) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/mask-2d | Partial update of a 2D mask for the model
465470
*ModelApi* | [**update_model**](docs/ModelApi.md#update_model) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/model/{id} | Update some fields of a model
@@ -502,6 +507,8 @@ Class | Method | HTTP request | Description
502507
## Documentation For Models
503508

504509
- [Auth](docs/Auth.md)
510+
- [BcfLabel](docs/BcfLabel.md)
511+
- [BcfLabelRequest](docs/BcfLabelRequest.md)
505512
- [BcfProject](docs/BcfProject.md)
506513
- [BcfProjectRequest](docs/BcfProjectRequest.md)
507514
- [Building](docs/Building.md)
@@ -552,6 +559,8 @@ Class | Method | HTTP request | Description
552559
- [FolderWithoutChildrenRequest](docs/FolderWithoutChildrenRequest.md)
553560
- [FullTopic](docs/FullTopic.md)
554561
- [FullTopicRequest](docs/FullTopicRequest.md)
562+
- [Geometry2dPoint](docs/Geometry2dPoint.md)
563+
- [Geometry2dPointRequest](docs/Geometry2dPointRequest.md)
555564
- [GeometryPoint](docs/GeometryPoint.md)
556565
- [GeometryPointRequest](docs/GeometryPointRequest.md)
557566
- [Group](docs/Group.md)
@@ -565,8 +574,6 @@ Class | Method | HTTP request | Description
565574
- [IfcOptimizeRequest](docs/IfcOptimizeRequest.md)
566575
- [ImportGroupRequest](docs/ImportGroupRequest.md)
567576
- [Invitation](docs/Invitation.md)
568-
- [Label](docs/Label.md)
569-
- [LabelRequest](docs/LabelRequest.md)
570577
- [Layer](docs/Layer.md)
571578
- [LayerElement](docs/LayerElement.md)
572579
- [LayerElementRequest](docs/LayerElementRequest.md)
@@ -591,13 +598,16 @@ Class | Method | HTTP request | Description
591598
- [ModelErrors](docs/ModelErrors.md)
592599
- [ModelErrorsRequest](docs/ModelErrorsRequest.md)
593600
- [ModelFiles](docs/ModelFiles.md)
601+
- [ModelLabel](docs/ModelLabel.md)
602+
- [ModelLabelRequest](docs/ModelLabelRequest.md)
594603
- [ModelProperty](docs/ModelProperty.md)
595604
- [ModelSerializerWithoutChildren](docs/ModelSerializerWithoutChildren.md)
596605
- [ModelWithPositioningPlan](docs/ModelWithPositioningPlan.md)
597606
- [Organization](docs/Organization.md)
598607
- [OrganizationRequest](docs/OrganizationRequest.md)
599608
- [OrthogonalCamera](docs/OrthogonalCamera.md)
600609
- [OrthogonalCameraRequest](docs/OrthogonalCameraRequest.md)
610+
- [PatchedBcfLabelRequest](docs/PatchedBcfLabelRequest.md)
601611
- [PatchedBcfProjectRequest](docs/PatchedBcfProjectRequest.md)
602612
- [PatchedClassificationRequest](docs/PatchedClassificationRequest.md)
603613
- [PatchedCloudRequest](docs/PatchedCloudRequest.md)
@@ -610,9 +620,9 @@ Class | Method | HTTP request | Description
610620
- [PatchedGroupFolderRequest](docs/PatchedGroupFolderRequest.md)
611621
- [PatchedGroupRequest](docs/PatchedGroupRequest.md)
612622
- [PatchedIfcAccessTokenRequest](docs/PatchedIfcAccessTokenRequest.md)
613-
- [PatchedLabelRequest](docs/PatchedLabelRequest.md)
614623
- [PatchedLayerRequest](docs/PatchedLayerRequest.md)
615624
- [PatchedMask2DRequest](docs/PatchedMask2DRequest.md)
625+
- [PatchedModelLabelRequest](docs/PatchedModelLabelRequest.md)
616626
- [PatchedModelRequest](docs/PatchedModelRequest.md)
617627
- [PatchedPinRequest](docs/PatchedPinRequest.md)
618628
- [PatchedPositioningPlanRequest](docs/PatchedPositioningPlanRequest.md)

0 commit comments

Comments
 (0)