Skip to content

Commit a5ba918

Browse files
committed
MINOR: Feature/smart files (#463)
* allow many model types * add tests * fix document name * more cleanup * update ci poetry version * do not reprocess on file update * fix export,merge and optimize queues * add types.py * more contants
1 parent 78b051b commit a5ba918

File tree

9 files changed

+81
-37
lines changed

9 files changed

+81
-37
lines changed

bimdata_api_client/api/ifc_api.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6257,7 +6257,7 @@ def delete_zone_space_with_http_info(self, cloud_pk, id, ifc_pk, project_pk, zon
62576257
def export_ifc(self, cloud_pk, id, project_pk, data, **kwargs): # noqa: E501
62586258
"""Export IFC # noqa: E501
62596259

6260-
Export IFC as requested in parameters. When the export is finished, a new IFC file with will be created in the same folder than the original IFC. You can query the folder or subscribe to the new document webhook to retrieve the result Required scopes: ifc:write # noqa: E501
6260+
Only works for IFC files. Export IFC as requested in parameters. When the export is finished, a new IFC file with will be created in the same folder than the original IFC. You can query the folder or subscribe to the new document webhook to retrieve the result Required scopes: ifc:write # noqa: E501
62616261
This method makes a synchronous HTTP request by default. To make an
62626262
asynchronous HTTP request, please pass async_req=True
62636263
>>> thread = api.export_ifc(cloud_pk, id, project_pk, data, async_req=True)
@@ -6285,7 +6285,7 @@ def export_ifc(self, cloud_pk, id, project_pk, data, **kwargs): # noqa: E501
62856285
def export_ifc_with_http_info(self, cloud_pk, id, project_pk, data, **kwargs): # noqa: E501
62866286
"""Export IFC # noqa: E501
62876287

6288-
Export IFC as requested in parameters. When the export is finished, a new IFC file with will be created in the same folder than the original IFC. You can query the folder or subscribe to the new document webhook to retrieve the result Required scopes: ifc:write # noqa: E501
6288+
Only works for IFC files. Export IFC as requested in parameters. When the export is finished, a new IFC file with will be created in the same folder than the original IFC. You can query the folder or subscribe to the new document webhook to retrieve the result Required scopes: ifc:write # noqa: E501
62896289
This method makes a synchronous HTTP request by default. To make an
62906290
asynchronous HTTP request, please pass async_req=True
62916291
>>> thread = api.export_ifc_with_http_info(cloud_pk, id, project_pk, data, async_req=True)
@@ -10315,7 +10315,7 @@ def get_ifc_units_with_http_info(self, cloud_pk, ifc_pk, project_pk, **kwargs):
1031510315
def get_ifcs(self, cloud_pk, project_pk, **kwargs): # noqa: E501
1031610316
"""Retrieve all models # noqa: E501
1031710317

10318-
Retrieve all models Required scopes: ifc:read # noqa: E501
10318+
Retrieve all models. For legacy reasons, this route is named IFC but now handle all models types (DWG, PDF, IFC, etc). The field `type` allows you to discriminate which kind of model it is. Required scopes: ifc:read # noqa: E501
1031910319
This method makes a synchronous HTTP request by default. To make an
1032010320
asynchronous HTTP request, please pass async_req=True
1032110321
>>> thread = api.get_ifcs(cloud_pk, project_pk, async_req=True)
@@ -10326,6 +10326,7 @@ def get_ifcs(self, cloud_pk, project_pk, **kwargs): # noqa: E501
1032610326
:param str project_pk: (required)
1032710327
:param str status: Filter the returned list by status
1032810328
:param str source: Filter the returned list by source
10329+
:param str type: Filter the returned list by type
1032910330
:param _preload_content: if False, the urllib3.HTTPResponse object will
1033010331
be returned without reading/decoding response
1033110332
data. Default is True.
@@ -10343,7 +10344,7 @@ def get_ifcs(self, cloud_pk, project_pk, **kwargs): # noqa: E501
1034310344
def get_ifcs_with_http_info(self, cloud_pk, project_pk, **kwargs): # noqa: E501
1034410345
"""Retrieve all models # noqa: E501
1034510346

10346-
Retrieve all models Required scopes: ifc:read # noqa: E501
10347+
Retrieve all models. For legacy reasons, this route is named IFC but now handle all models types (DWG, PDF, IFC, etc). The field `type` allows you to discriminate which kind of model it is. Required scopes: ifc:read # noqa: E501
1034710348
This method makes a synchronous HTTP request by default. To make an
1034810349
asynchronous HTTP request, please pass async_req=True
1034910350
>>> thread = api.get_ifcs_with_http_info(cloud_pk, project_pk, async_req=True)
@@ -10354,6 +10355,7 @@ def get_ifcs_with_http_info(self, cloud_pk, project_pk, **kwargs): # noqa: E501
1035410355
:param str project_pk: (required)
1035510356
:param str status: Filter the returned list by status
1035610357
:param str source: Filter the returned list by source
10358+
:param str type: Filter the returned list by type
1035710359
:param _return_http_data_only: response data without head status code
1035810360
and headers
1035910361
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -10374,7 +10376,8 @@ def get_ifcs_with_http_info(self, cloud_pk, project_pk, **kwargs): # noqa: E501
1037410376
'cloud_pk',
1037510377
'project_pk',
1037610378
'status',
10377-
'source'
10379+
'source',
10380+
'type'
1037810381
]
1037910382
all_params.extend(
1038010383
[
@@ -10415,6 +10418,8 @@ def get_ifcs_with_http_info(self, cloud_pk, project_pk, **kwargs): # noqa: E501
1041510418
query_params.append(('status', local_var_params['status'])) # noqa: E501
1041610419
if 'source' in local_var_params and local_var_params['source'] is not None: # noqa: E501
1041710420
query_params.append(('source', local_var_params['source'])) # noqa: E501
10421+
if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501
10422+
query_params.append(('type', local_var_params['type'])) # noqa: E501
1041810423

1041910424
header_params = {}
1042010425

@@ -13394,7 +13399,7 @@ def list_classification_element_relations_with_http_info(self, cloud_pk, ifc_pk,
1339413399
def merge_ifcs(self, cloud_pk, project_pk, data, **kwargs): # noqa: E501
1339513400
"""Merge IFC files # noqa: E501
1339613401

13397-
Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write # noqa: E501
13402+
Only works for IFC files. Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write # noqa: E501
1339813403
This method makes a synchronous HTTP request by default. To make an
1339913404
asynchronous HTTP request, please pass async_req=True
1340013405
>>> thread = api.merge_ifcs(cloud_pk, project_pk, data, async_req=True)
@@ -13421,7 +13426,7 @@ def merge_ifcs(self, cloud_pk, project_pk, data, **kwargs): # noqa: E501
1342113426
def merge_ifcs_with_http_info(self, cloud_pk, project_pk, data, **kwargs): # noqa: E501
1342213427
"""Merge IFC files # noqa: E501
1342313428

13424-
Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write # noqa: E501
13429+
Only works for IFC files. Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write # noqa: E501
1342513430
This method makes a synchronous HTTP request by default. To make an
1342613431
asynchronous HTTP request, please pass async_req=True
1342713432
>>> thread = api.merge_ifcs_with_http_info(cloud_pk, project_pk, data, async_req=True)
@@ -13526,7 +13531,7 @@ def merge_ifcs_with_http_info(self, cloud_pk, project_pk, data, **kwargs): # no
1352613531
def optimize_ifc(self, cloud_pk, id, project_pk, data, **kwargs): # noqa: E501
1352713532
"""Optimize the IFC # noqa: E501
1352813533

13529-
Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write # noqa: E501
13534+
Only works for IFC files. Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write # noqa: E501
1353013535
This method makes a synchronous HTTP request by default. To make an
1353113536
asynchronous HTTP request, please pass async_req=True
1353213537
>>> thread = api.optimize_ifc(cloud_pk, id, project_pk, data, async_req=True)
@@ -13554,7 +13559,7 @@ def optimize_ifc(self, cloud_pk, id, project_pk, data, **kwargs): # noqa: E501
1355413559
def optimize_ifc_with_http_info(self, cloud_pk, id, project_pk, data, **kwargs): # noqa: E501
1355513560
"""Optimize the IFC # noqa: E501
1355613561

13557-
Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write # noqa: E501
13562+
Only works for IFC files. Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write # noqa: E501
1355813563
This method makes a synchronous HTTP request by default. To make an
1355913564
asynchronous HTTP request, please pass async_req=True
1356013565
>>> thread = api.optimize_ifc_with_http_info(cloud_pk, id, project_pk, data, async_req=True)

bimdata_api_client/models/ifc.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Ifc(object):
3636
openapi_types = {
3737
'id': 'int',
3838
'name': 'str',
39+
'type': 'str',
3940
'creator': 'User',
4041
'status': 'str',
4142
'source': 'str',
@@ -63,6 +64,7 @@ class Ifc(object):
6364
attribute_map = {
6465
'id': 'id',
6566
'name': 'name',
67+
'type': 'type',
6668
'creator': 'creator',
6769
'status': 'status',
6870
'source': 'source',
@@ -87,14 +89,15 @@ class Ifc(object):
8789
'recommanded_2d_angle': 'recommanded_2d_angle'
8890
}
8991

90-
def __init__(self, id=None, name=None, creator=None, status=None, source=None, created_at=None, updated_at=None, document_id=None, document=None, structure_file=None, systems_file=None, map_file=None, gltf_file=None, bvh_tree_file=None, viewer_360_file=None, xkt_file=None, project_id=None, world_position=None, errors=None, warnings=None, archived=None, version=None, north_vector=None, recommanded_2d_angle=None, local_vars_configuration=None): # noqa: E501
92+
def __init__(self, id=None, name=None, type=None, creator=None, status=None, source=None, created_at=None, updated_at=None, document_id=None, document=None, structure_file=None, systems_file=None, map_file=None, gltf_file=None, bvh_tree_file=None, viewer_360_file=None, xkt_file=None, project_id=None, world_position=None, errors=None, warnings=None, archived=None, version=None, north_vector=None, recommanded_2d_angle=None, local_vars_configuration=None): # noqa: E501
9193
"""Ifc - a model defined in OpenAPI""" # noqa: E501
9294
if local_vars_configuration is None:
9395
local_vars_configuration = Configuration()
9496
self.local_vars_configuration = local_vars_configuration
9597

9698
self._id = None
9799
self._name = None
100+
self._type = None
98101
self._creator = None
99102
self._status = None
100103
self._source = None
@@ -123,6 +126,8 @@ def __init__(self, id=None, name=None, creator=None, status=None, source=None, c
123126
self.id = id
124127
if name is not None:
125128
self.name = name
129+
if type is not None:
130+
self.type = type
126131
if creator is not None:
127132
self.creator = creator
128133
if status is not None:
@@ -206,6 +211,30 @@ def name(self, name):
206211

207212
self._name = name
208213

214+
@property
215+
def type(self):
216+
"""Gets the type of this Ifc. # noqa: E501
217+
218+
219+
:return: The type of this Ifc. # noqa: E501
220+
:rtype: str
221+
"""
222+
return self._type
223+
224+
@type.setter
225+
def type(self, type):
226+
"""Sets the type of this Ifc.
227+
228+
229+
:param type: The type of this Ifc. # noqa: E501
230+
:type: str
231+
"""
232+
if (self.local_vars_configuration.client_side_validation and
233+
type is not None and len(type) < 1):
234+
raise ValueError("Invalid value for `type`, length must be greater than or equal to `1`") # noqa: E501
235+
236+
self._type = type
237+
209238
@property
210239
def creator(self):
211240
"""Gets the creator of this Ifc. # noqa: E501

bimdata_api_client/models/processor_handler.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,34 @@ class ProcessorHandler(object):
3535
"""
3636
openapi_types = {
3737
'id': 'int',
38-
'processor': 'int',
38+
'worker': 'str',
3939
'status': 'str',
4040
'detail_message': 'str'
4141
}
4242

4343
attribute_map = {
4444
'id': 'id',
45-
'processor': 'processor',
45+
'worker': 'worker',
4646
'status': 'status',
4747
'detail_message': 'detail_message'
4848
}
4949

50-
def __init__(self, id=None, processor=None, status=None, detail_message=None, local_vars_configuration=None): # noqa: E501
50+
def __init__(self, id=None, worker=None, status=None, detail_message=None, local_vars_configuration=None): # noqa: E501
5151
"""ProcessorHandler - a model defined in OpenAPI""" # noqa: E501
5252
if local_vars_configuration is None:
5353
local_vars_configuration = Configuration()
5454
self.local_vars_configuration = local_vars_configuration
5555

5656
self._id = None
57-
self._processor = None
57+
self._worker = None
5858
self._status = None
5959
self._detail_message = None
6060
self.discriminator = None
6161

6262
if id is not None:
6363
self.id = id
64-
if processor is not None:
65-
self.processor = processor
64+
if worker is not None:
65+
self.worker = worker
6666
if status is not None:
6767
self.status = status
6868
self.detail_message = detail_message
@@ -89,25 +89,28 @@ def id(self, id):
8989
self._id = id
9090

9191
@property
92-
def processor(self):
93-
"""Gets the processor of this ProcessorHandler. # noqa: E501
92+
def worker(self):
93+
"""Gets the worker of this ProcessorHandler. # noqa: E501
9494
9595
96-
:return: The processor of this ProcessorHandler. # noqa: E501
97-
:rtype: int
96+
:return: The worker of this ProcessorHandler. # noqa: E501
97+
:rtype: str
9898
"""
99-
return self._processor
99+
return self._worker
100100

101-
@processor.setter
102-
def processor(self, processor):
103-
"""Sets the processor of this ProcessorHandler.
101+
@worker.setter
102+
def worker(self, worker):
103+
"""Sets the worker of this ProcessorHandler.
104104
105105
106-
:param processor: The processor of this ProcessorHandler. # noqa: E501
107-
:type: int
106+
:param worker: The worker of this ProcessorHandler. # noqa: E501
107+
:type: str
108108
"""
109+
if (self.local_vars_configuration.client_side_validation and
110+
worker is not None and len(worker) < 1):
111+
raise ValueError("Invalid value for `worker`, length must be greater than or equal to `1`") # noqa: E501
109112

110-
self._processor = processor
113+
self._worker = worker
111114

112115
@property
113116
def status(self):

docs/Ifc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**id** | **int** | | [optional] [readonly]
77
**name** | **str** | | [optional] [readonly]
8+
**type** | **str** | | [optional] [readonly]
89
**creator** | [**User**](User.md) | | [optional]
910
**status** | **str** | | [optional] [readonly]
1011
**source** | **str** | | [optional]

docs/IfcApi.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9320,7 +9320,7 @@ void (empty response body)
93209320

93219321
Export IFC
93229322

9323-
Export IFC as requested in parameters. When the export is finished, a new IFC file with will be created in the same folder than the original IFC. You can query the folder or subscribe to the new document webhook to retrieve the result Required scopes: ifc:write
9323+
Only works for IFC files. Export IFC as requested in parameters. When the export is finished, a new IFC file with will be created in the same folder than the original IFC. You can query the folder or subscribe to the new document webhook to retrieve the result Required scopes: ifc:write
93249324

93259325
### Example
93269326

@@ -15364,11 +15364,11 @@ Name | Type | Description | Notes
1536415364
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
1536515365

1536615366
# **get_ifcs**
15367-
> list[Ifc] get_ifcs(cloud_pk, project_pk, status=status, source=source)
15367+
> list[Ifc] get_ifcs(cloud_pk, project_pk, status=status, source=source, type=type)
1536815368

1536915369
Retrieve all models
1537015370

15371-
Retrieve all models Required scopes: ifc:read
15371+
Retrieve all models. For legacy reasons, this route is named IFC but now handle all models types (DWG, PDF, IFC, etc). The field `type` allows you to discriminate which kind of model it is. Required scopes: ifc:read
1537215372

1537315373
### Example
1537415374

@@ -15420,10 +15420,11 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
1542015420
project_pk = 'project_pk_example' # str |
1542115421
status = 'status_example' # str | Filter the returned list by status (optional)
1542215422
source = 'source_example' # str | Filter the returned list by source (optional)
15423+
type = 'type_example' # str | Filter the returned list by type (optional)
1542315424

1542415425
try:
1542515426
# Retrieve all models
15426-
api_response = api_instance.get_ifcs(cloud_pk, project_pk, status=status, source=source)
15427+
api_response = api_instance.get_ifcs(cloud_pk, project_pk, status=status, source=source, type=type)
1542715428
pprint(api_response)
1542815429
except ApiException as e:
1542915430
print("Exception when calling IfcApi->get_ifcs: %s\n" % e)
@@ -15477,10 +15478,11 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
1547715478
project_pk = 'project_pk_example' # str |
1547815479
status = 'status_example' # str | Filter the returned list by status (optional)
1547915480
source = 'source_example' # str | Filter the returned list by source (optional)
15481+
type = 'type_example' # str | Filter the returned list by type (optional)
1548015482

1548115483
try:
1548215484
# Retrieve all models
15483-
api_response = api_instance.get_ifcs(cloud_pk, project_pk, status=status, source=source)
15485+
api_response = api_instance.get_ifcs(cloud_pk, project_pk, status=status, source=source, type=type)
1548415486
pprint(api_response)
1548515487
except ApiException as e:
1548615488
print("Exception when calling IfcApi->get_ifcs: %s\n" % e)
@@ -15534,10 +15536,11 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
1553415536
project_pk = 'project_pk_example' # str |
1553515537
status = 'status_example' # str | Filter the returned list by status (optional)
1553615538
source = 'source_example' # str | Filter the returned list by source (optional)
15539+
type = 'type_example' # str | Filter the returned list by type (optional)
1553715540

1553815541
try:
1553915542
# Retrieve all models
15540-
api_response = api_instance.get_ifcs(cloud_pk, project_pk, status=status, source=source)
15543+
api_response = api_instance.get_ifcs(cloud_pk, project_pk, status=status, source=source, type=type)
1554115544
pprint(api_response)
1554215545
except ApiException as e:
1554315546
print("Exception when calling IfcApi->get_ifcs: %s\n" % e)
@@ -15551,6 +15554,7 @@ Name | Type | Description | Notes
1555115554
**project_pk** | **str**| |
1555215555
**status** | **str**| Filter the returned list by status | [optional]
1555315556
**source** | **str**| Filter the returned list by source | [optional]
15557+
**type** | **str**| Filter the returned list by type | [optional]
1555415558

1555515559
### Return type
1555615560

@@ -20080,7 +20084,7 @@ Name | Type | Description | Notes
2008020084

2008120085
Merge IFC files
2008220086

20083-
Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write
20087+
Only works for IFC files. Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list Required scopes: ifc:write
2008420088

2008520089
### Example
2008620090

@@ -20287,7 +20291,7 @@ void (empty response body)
2028720291

2028820292
Optimize the IFC
2028920293

20290-
Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write
20294+
Only works for IFC files. Optimize the IFC. A new optimized IFC file will be put in the same folder that the original IFC Required scopes: ifc:write
2029120295

2029220296
### Example
2029320297

docs/ProcessorHandler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**id** | **int** | | [optional] [readonly]
7-
**processor** | **int** | | [optional] [readonly]
7+
**worker** | **str** | | [optional] [readonly]
88
**status** | **str** | | [optional]
99
**detail_message** | **str** | | [optional]
1010

test/test_ifc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def make_instance(self, include_optional):
3939
return Ifc(
4040
id = 56,
4141
name = '0',
42+
type = '0',
4243
creator = bimdata_api_client.models.user.User(
4344
id = 56,
4445
email = '0',

0 commit comments

Comments
 (0)