Skip to content

Commit cac80c2

Browse files
committed
PATCH: fix(equipment): fix equipment image url and serializer (#1035)
* PATCH: fix(equipment): fix equipment image url and serializer * PATCH: fix(equipment): use LightFosUserSerializer for equipment creator * fix(equipment): add tests for num queries * fix(equipment): prefetch equipment images * fix(equipment): select related creator in queryset
1 parent f29d944 commit cac80c2

34 files changed

Lines changed: 896 additions & 188 deletions

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ bimdata_api_client/model/document_text.py
5858
bimdata_api_client/model/document_with_element_list.py
5959
bimdata_api_client/model/drawing.py
6060
bimdata_api_client/model/drawing_request.py
61+
bimdata_api_client/model/edit_comment.py
62+
bimdata_api_client/model/edit_comment_request.py
6163
bimdata_api_client/model/element.py
6264
bimdata_api_client/model/element_classification_relation.py
6365
bimdata_api_client/model/element_classification_relation_request.py
@@ -349,6 +351,8 @@ docs/DocumentText.md
349351
docs/DocumentWithElementList.md
350352
docs/Drawing.md
351353
docs/DrawingRequest.md
354+
docs/EditComment.md
355+
docs/EditCommentRequest.md
352356
docs/Element.md
353357
docs/ElementClassificationRelation.md
354358
docs/ElementClassificationRelationRequest.md
@@ -644,6 +648,8 @@ test/test_document_text.py
644648
test/test_document_with_element_list.py
645649
test/test_drawing.py
646650
test/test_drawing_request.py
651+
test/test_edit_comment.py
652+
test/test_edit_comment_request.py
647653
test/test_element.py
648654
test/test_element_classification_relation.py
649655
test/test_element_classification_relation_request.py

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ from bimdata_api_client.model.comment_request import CommentRequest
6565
from bimdata_api_client.model.detailed_extensions import DetailedExtensions
6666
from bimdata_api_client.model.document_reference import DocumentReference
6767
from bimdata_api_client.model.document_reference_request import DocumentReferenceRequest
68+
from bimdata_api_client.model.edit_comment import EditComment
69+
from bimdata_api_client.model.edit_comment_request import EditCommentRequest
6870
from bimdata_api_client.model.extensions import Extensions
6971
from bimdata_api_client.model.full_topic import FullTopic
7072
from bimdata_api_client.model.full_topic_request import FullTopicRequest
@@ -142,14 +144,14 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
142144
projects_pk = 1 # int | A unique integer value identifying this project.
143145
topics_guid = "topics_guid_example" # str |
144146
comment_request = CommentRequest(
145-
guid="guid_example",
146-
date=dateutil_parser('1970-01-01T00:00:00.00Z'),
147147
author="author_example",
148-
comment="comment_example",
148+
date=dateutil_parser('1970-01-01T00:00:00.00Z'),
149149
viewpoint_guid="viewpoint_guid_example",
150-
reply_to_comment_guid="reply_to_comment_guid_example",
151-
modified_author="modified_author_example",
150+
comment="comment_example",
152151
viewpoint_temp_id=1,
152+
modified_author="modified_author_example",
153+
reply_to_comment_guid="reply_to_comment_guid_example",
154+
guid="guid_example",
153155
) # CommentRequest | (optional)
154156

155157
try:
@@ -346,7 +348,7 @@ Class | Method | HTTP request | Description
346348
*CollaborationApi* | [**update_validation**](docs/CollaborationApi.md#update_validation) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/validation/{id} | Update the validator of validation
347349
*CollaborationApi* | [**update_visa**](docs/CollaborationApi.md#update_visa) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{id} | Update some fields of a visa
348350
*CollaborationApi* | [**update_visa_comment**](docs/CollaborationApi.md#update_visa_comment) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/comment/{id} | Update some fields of a comment
349-
*ModelApi* | [**add_equipment_image**](docs/ModelApi.md#add_equipment_image) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/equipment-image | Add a new image to the equipment
351+
*ModelApi* | [**add_equipment_image**](docs/ModelApi.md#add_equipment_image) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/image | Add a new image to the equipment
350352
*ModelApi* | [**add_model_errors**](docs/ModelApi.md#add_model_errors) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/errors | Add errors to model
351353
*ModelApi* | [**add_zone_space**](docs/ModelApi.md#add_zone_space) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/zone/{zone_pk}/space/add | Add a space to a zone
352354
*ModelApi* | [**bulk_delete_model_classifications**](docs/ModelApi.md#bulk_delete_model_classifications) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/classification/list_destroy | Remove all classifications from model's elements
@@ -401,7 +403,7 @@ Class | Method | HTTP request | Description
401403
*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
402404
*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
403405
*ModelApi* | [**delete_equipment**](docs/ModelApi.md#delete_equipment) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{id} | Delete an equipment
404-
*ModelApi* | [**delete_equipment_image**](docs/ModelApi.md#delete_equipment_image) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/equipment-image/{id} | Remove an equipment image
406+
*ModelApi* | [**delete_equipment_image**](docs/ModelApi.md#delete_equipment_image) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/image/{id} | Remove an equipment image
405407
*ModelApi* | [**delete_label**](docs/ModelApi.md#delete_label) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/label/{id} | Delete a label
406408
*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
407409
*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
@@ -442,7 +444,7 @@ Class | Method | HTTP request | Description
442444
*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
443445
*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
444446
*ModelApi* | [**get_equipment**](docs/ModelApi.md#get_equipment) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{id} | Retrieve one equipment of the model
445-
*ModelApi* | [**get_equipment_images**](docs/ModelApi.md#get_equipment_images) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/equipment-image | Retrieve all images attached to the equipment
447+
*ModelApi* | [**get_equipment_images**](docs/ModelApi.md#get_equipment_images) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/image | Retrieve all images attached to the equipment
446448
*ModelApi* | [**get_equipments**](docs/ModelApi.md#get_equipments) | **GET** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment | Retrieve all equipments of the model
447449
*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
448450
*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
@@ -593,6 +595,8 @@ Class | Method | HTTP request | Description
593595
- [DocumentWithElementList](docs/DocumentWithElementList.md)
594596
- [Drawing](docs/Drawing.md)
595597
- [DrawingRequest](docs/DrawingRequest.md)
598+
- [EditComment](docs/EditComment.md)
599+
- [EditCommentRequest](docs/EditCommentRequest.md)
596600
- [Element](docs/Element.md)
597601
- [ElementClassificationRelation](docs/ElementClassificationRelation.md)
598602
- [ElementClassificationRelationRequest](docs/ElementClassificationRelationRequest.md)

bimdata_api_client/api/bcf_api.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
from bimdata_api_client.model.detailed_extensions import DetailedExtensions
3636
from bimdata_api_client.model.document_reference import DocumentReference
3737
from bimdata_api_client.model.document_reference_request import DocumentReferenceRequest
38+
from bimdata_api_client.model.edit_comment import EditComment
39+
from bimdata_api_client.model.edit_comment_request import EditCommentRequest
3840
from bimdata_api_client.model.extensions import Extensions
3941
from bimdata_api_client.model.full_topic import FullTopic
4042
from bimdata_api_client.model.full_topic_request import FullTopicRequest
@@ -1718,7 +1720,7 @@ def __init__(self, api_client=None):
17181720
)
17191721
self.full_update_comment_endpoint = _Endpoint(
17201722
settings={
1721-
'response_type': (Comment,),
1723+
'response_type': (EditComment,),
17221724
'auth': [
17231725
'ApiKey',
17241726
'BIMData_Connect',
@@ -1735,7 +1737,7 @@ def __init__(self, api_client=None):
17351737
'guid',
17361738
'projects_pk',
17371739
'topics_guid',
1738-
'comment_request',
1740+
'edit_comment_request',
17391741
],
17401742
'required': [
17411743
'guid',
@@ -1761,8 +1763,8 @@ def __init__(self, api_client=None):
17611763
(int,),
17621764
'topics_guid':
17631765
(str,),
1764-
'comment_request':
1765-
(CommentRequest,),
1766+
'edit_comment_request':
1767+
(EditCommentRequest,),
17661768
},
17671769
'attribute_map': {
17681770
'guid': 'guid',
@@ -1773,7 +1775,7 @@ def __init__(self, api_client=None):
17731775
'guid': 'path',
17741776
'projects_pk': 'path',
17751777
'topics_guid': 'path',
1776-
'comment_request': 'body',
1778+
'edit_comment_request': 'body',
17771779
},
17781780
'collection_format_map': {
17791781
}
@@ -6819,7 +6821,7 @@ def full_update_comment(
68196821
topics_guid (str):
68206822
68216823
Keyword Args:
6822-
comment_request (CommentRequest): [optional]
6824+
edit_comment_request (EditCommentRequest): [optional]
68236825
_return_http_data_only (bool): response data without head status
68246826
code and headers. Default is True.
68256827
_preload_content (bool): if False, the urllib3.HTTPResponse object
@@ -6848,7 +6850,7 @@ def full_update_comment(
68486850
async_req (bool): execute request asynchronously
68496851
68506852
Returns:
6851-
Comment
6853+
EditComment
68526854
If the method is called asynchronously, returns the request
68536855
thread.
68546856
"""

bimdata_api_client/api/collaboration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9344,7 +9344,7 @@ def create_document(
93449344
):
93459345
"""Create a document # noqa: E501
93469346

9347-
Create a document. If the document is one of {'GLTF', 'PHOTOSPHERE', 'POINT_CLOUD', 'DXF', 'DWG', 'IFC', 'OBJ'}, a model will be created and attached to this document Required scopes: document:write # noqa: E501
9347+
Create a document. If the document is one of {'DWG', 'POINT_CLOUD', 'OBJ', 'DXF', 'IFC', 'PHOTOSPHERE', 'GLTF'}, a model will be created and attached to this document Required scopes: document:write # noqa: E501
93489348
This method makes a synchronous HTTP request by default. To make an
93499349
asynchronous HTTP request, please pass async_req=True
93509350

bimdata_api_client/api/model_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def __init__(self, api_client=None):
133133
'BIMData_Connect',
134134
'Bearer'
135135
],
136-
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/equipment-image',
136+
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/image',
137137
'operation_id': 'add_equipment_image',
138138
'http_method': 'POST',
139139
'servers': None,
@@ -4368,7 +4368,7 @@ def __init__(self, api_client=None):
43684368
'BIMData_Connect',
43694369
'Bearer'
43704370
],
4371-
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/equipment-image/{id}',
4371+
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/image/{id}',
43724372
'operation_id': 'delete_equipment_image',
43734373
'http_method': 'DELETE',
43744374
'servers': None,
@@ -7408,7 +7408,7 @@ def __init__(self, api_client=None):
74087408
'BIMData_Connect',
74097409
'Bearer'
74107410
],
7411-
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/equipment-image',
7411+
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/equipment/{equipment_pk}/image',
74127412
'operation_id': 'get_equipment_images',
74137413
'http_method': 'GET',
74147414
'servers': None,

bimdata_api_client/model/comment.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ def openapi_types():
9090
return {
9191
'topic_guid': (str,), # noqa: E501
9292
'modified_date': (datetime,), # noqa: E501
93-
'guid': (str,), # noqa: E501
94-
'date': (datetime,), # noqa: E501
9593
'author': (str, none_type,), # noqa: E501
96-
'comment': (str,), # noqa: E501
94+
'date': (datetime,), # noqa: E501
9795
'viewpoint_guid': (str, none_type,), # noqa: E501
98-
'reply_to_comment_guid': (str, none_type,), # noqa: E501
96+
'comment': (str,), # noqa: E501
9997
'modified_author': (str, none_type,), # noqa: E501
98+
'reply_to_comment_guid': (str, none_type,), # noqa: E501
99+
'guid': (str,), # noqa: E501
100100
}
101101

102102
@cached_property
@@ -107,13 +107,13 @@ def discriminator():
107107
attribute_map = {
108108
'topic_guid': 'topic_guid', # noqa: E501
109109
'modified_date': 'modified_date', # noqa: E501
110-
'guid': 'guid', # noqa: E501
111-
'date': 'date', # noqa: E501
112110
'author': 'author', # noqa: E501
113-
'comment': 'comment', # noqa: E501
111+
'date': 'date', # noqa: E501
114112
'viewpoint_guid': 'viewpoint_guid', # noqa: E501
115-
'reply_to_comment_guid': 'reply_to_comment_guid', # noqa: E501
113+
'comment': 'comment', # noqa: E501
116114
'modified_author': 'modified_author', # noqa: E501
115+
'reply_to_comment_guid': 'reply_to_comment_guid', # noqa: E501
116+
'guid': 'guid', # noqa: E501
117117
}
118118

119119
read_only_vars = {
@@ -163,13 +163,13 @@ def _from_openapi_data(cls, topic_guid, modified_date, *args, **kwargs): # noqa
163163
Animal class but this time we won't travel
164164
through its discriminator because we passed in
165165
_visited_composed_classes = (Animal,)
166-
guid (str): [optional] # noqa: E501
167-
date (datetime): [optional] # noqa: E501
168166
author (str, none_type): [optional] # noqa: E501
169-
comment (str): [optional] # noqa: E501
167+
date (datetime): [optional] # noqa: E501
170168
viewpoint_guid (str, none_type): [optional] # noqa: E501
171-
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
169+
comment (str): [optional] # noqa: E501
172170
modified_author (str, none_type): [optional] # noqa: E501
171+
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
172+
guid (str): [optional] # noqa: E501
173173
"""
174174

175175
_check_type = kwargs.pop('_check_type', True)
@@ -253,13 +253,13 @@ def __init__(self, *args, **kwargs): # noqa: E501
253253
Animal class but this time we won't travel
254254
through its discriminator because we passed in
255255
_visited_composed_classes = (Animal,)
256-
guid (str): [optional] # noqa: E501
257-
date (datetime): [optional] # noqa: E501
258256
author (str, none_type): [optional] # noqa: E501
259-
comment (str): [optional] # noqa: E501
257+
date (datetime): [optional] # noqa: E501
260258
viewpoint_guid (str, none_type): [optional] # noqa: E501
261-
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
259+
comment (str): [optional] # noqa: E501
262260
modified_author (str, none_type): [optional] # noqa: E501
261+
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
262+
guid (str): [optional] # noqa: E501
263263
"""
264264

265265
_check_type = kwargs.pop('_check_type', True)

0 commit comments

Comments
 (0)