Skip to content

Commit b224801

Browse files
committed
PATCH: Add non automatic models (#464)
* Add non automatic models * improve tests * rename route and add permissions * add model delete with doc
1 parent 08061f7 commit b224801

File tree

12 files changed

+902
-8
lines changed

12 files changed

+902
-8
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ Class | Method | HTTP request | Description
290290
*IfcApi* | [**create_ifc_property_definition**](docs/IfcApi.md#create_ifc_property_definition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertydefinition | Create a PropertyDefinition on the model
291291
*IfcApi* | [**create_ifc_unit**](docs/IfcApi.md#create_ifc_unit) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/unit | Create a Unit on a model
292292
*IfcApi* | [**create_layer**](docs/IfcApi.md#create_layer) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/layer | Create a layer in the model
293+
*IfcApi* | [**create_model**](docs/IfcApi.md#create_model) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/create-model | Make a PDF or Image file a Model
293294
*IfcApi* | [**create_property_set**](docs/IfcApi.md#create_property_set) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset | Create a PropertySet
294295
*IfcApi* | [**create_property_set_element_relations**](docs/IfcApi.md#create_property_set_element_relations) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset-element | Create association between PropertySet and element
295296
*IfcApi* | [**create_raw_elements**](docs/IfcApi.md#create_raw_elements) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/raw | Create elements in an optimized format
@@ -304,6 +305,7 @@ Class | Method | HTTP request | Description
304305
*IfcApi* | [**delete_ifc_property_definition**](docs/IfcApi.md#delete_ifc_property_definition) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertydefinition/{id} | Delete a PropertyDefinitions of a model
305306
*IfcApi* | [**delete_ifc_unit**](docs/IfcApi.md#delete_ifc_unit) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/unit/{id} | Delete a Unit of a model
306307
*IfcApi* | [**delete_layer**](docs/IfcApi.md#delete_layer) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/layer/{id} | Delete a layer of a model
308+
*IfcApi* | [**delete_model_without_doc**](docs/IfcApi.md#delete_model_without_doc) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/delete-model | Delete the Model without deleting the related document
307309
*IfcApi* | [**delete_property_set**](docs/IfcApi.md#delete_property_set) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset/{id} | Delete a PropertySet of a model
308310
*IfcApi* | [**delete_space**](docs/IfcApi.md#delete_space) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/space/{id} | Delete a space
309311
*IfcApi* | [**delete_system**](docs/IfcApi.md#delete_system) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/system/{uuid} | Delete a system of a model
@@ -412,6 +414,7 @@ Class | Method | HTTP request | Description
412414
- [Comment](docs/Comment.md)
413415
- [Component](docs/Component.md)
414416
- [ComponentsParent](docs/ComponentsParent.md)
417+
- [CreateModel](docs/CreateModel.md)
415418
- [Direction](docs/Direction.md)
416419
- [Document](docs/Document.md)
417420
- [DocumentWithElementList](docs/DocumentWithElementList.md)

bimdata_api_client/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from bimdata_api_client.models.comment import Comment
4747
from bimdata_api_client.models.component import Component
4848
from bimdata_api_client.models.components_parent import ComponentsParent
49+
from bimdata_api_client.models.create_model import CreateModel
4950
from bimdata_api_client.models.direction import Direction
5051
from bimdata_api_client.models.document import Document
5152
from bimdata_api_client.models.document_with_element_list import DocumentWithElementList

bimdata_api_client/api/ifc_api.py

Lines changed: 266 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,6 +3594,142 @@ def create_layer_with_http_info(self, cloud_pk, ifc_pk, project_pk, data, **kwar
35943594
_request_timeout=local_var_params.get('_request_timeout'),
35953595
collection_formats=collection_formats)
35963596

3597+
def create_model(self, cloud_pk, project_pk, data, **kwargs): # noqa: E501
3598+
"""Make a PDF or Image file a Model # noqa: E501
3599+
3600+
Make a PDF or Image file a Model to be used in BIMData services Required scopes: ifc:write # noqa: E501
3601+
This method makes a synchronous HTTP request by default. To make an
3602+
asynchronous HTTP request, please pass async_req=True
3603+
>>> thread = api.create_model(cloud_pk, project_pk, data, async_req=True)
3604+
>>> result = thread.get()
3605+
3606+
:param async_req bool: execute request asynchronously
3607+
:param str cloud_pk: (required)
3608+
:param str project_pk: (required)
3609+
:param CreateModel data: (required)
3610+
:param _preload_content: if False, the urllib3.HTTPResponse object will
3611+
be returned without reading/decoding response
3612+
data. Default is True.
3613+
:param _request_timeout: timeout setting for this request. If one
3614+
number provided, it will be total request
3615+
timeout. It can also be a pair (tuple) of
3616+
(connection, read) timeouts.
3617+
:return: Ifc
3618+
If the method is called asynchronously,
3619+
returns the request thread.
3620+
"""
3621+
kwargs['_return_http_data_only'] = True
3622+
return self.create_model_with_http_info(cloud_pk, project_pk, data, **kwargs) # noqa: E501
3623+
3624+
def create_model_with_http_info(self, cloud_pk, project_pk, data, **kwargs): # noqa: E501
3625+
"""Make a PDF or Image file a Model # noqa: E501
3626+
3627+
Make a PDF or Image file a Model to be used in BIMData services Required scopes: ifc:write # noqa: E501
3628+
This method makes a synchronous HTTP request by default. To make an
3629+
asynchronous HTTP request, please pass async_req=True
3630+
>>> thread = api.create_model_with_http_info(cloud_pk, project_pk, data, async_req=True)
3631+
>>> result = thread.get()
3632+
3633+
:param async_req bool: execute request asynchronously
3634+
:param str cloud_pk: (required)
3635+
:param str project_pk: (required)
3636+
:param CreateModel data: (required)
3637+
:param _return_http_data_only: response data without head status code
3638+
and headers
3639+
:param _preload_content: if False, the urllib3.HTTPResponse object will
3640+
be returned without reading/decoding response
3641+
data. Default is True.
3642+
:param _request_timeout: timeout setting for this request. If one
3643+
number provided, it will be total request
3644+
timeout. It can also be a pair (tuple) of
3645+
(connection, read) timeouts.
3646+
:return: tuple(Ifc, status_code(int), headers(HTTPHeaderDict))
3647+
If the method is called asynchronously,
3648+
returns the request thread.
3649+
"""
3650+
3651+
local_var_params = locals()
3652+
3653+
all_params = [
3654+
'cloud_pk',
3655+
'project_pk',
3656+
'data'
3657+
]
3658+
all_params.extend(
3659+
[
3660+
'async_req',
3661+
'_return_http_data_only',
3662+
'_preload_content',
3663+
'_request_timeout'
3664+
]
3665+
)
3666+
3667+
for key, val in six.iteritems(local_var_params['kwargs']):
3668+
if key not in all_params:
3669+
raise ApiTypeError(
3670+
"Got an unexpected keyword argument '%s'"
3671+
" to method create_model" % key
3672+
)
3673+
local_var_params[key] = val
3674+
del local_var_params['kwargs']
3675+
# verify the required parameter 'cloud_pk' is set
3676+
if self.api_client.client_side_validation and ('cloud_pk' not in local_var_params or # noqa: E501
3677+
local_var_params['cloud_pk'] is None): # noqa: E501
3678+
raise ApiValueError("Missing the required parameter `cloud_pk` when calling `create_model`") # noqa: E501
3679+
# verify the required parameter 'project_pk' is set
3680+
if self.api_client.client_side_validation and ('project_pk' not in local_var_params or # noqa: E501
3681+
local_var_params['project_pk'] is None): # noqa: E501
3682+
raise ApiValueError("Missing the required parameter `project_pk` when calling `create_model`") # noqa: E501
3683+
# verify the required parameter 'data' is set
3684+
if self.api_client.client_side_validation and ('data' not in local_var_params or # noqa: E501
3685+
local_var_params['data'] is None): # noqa: E501
3686+
raise ApiValueError("Missing the required parameter `data` when calling `create_model`") # noqa: E501
3687+
3688+
collection_formats = {}
3689+
3690+
path_params = {}
3691+
if 'cloud_pk' in local_var_params:
3692+
path_params['cloud_pk'] = local_var_params['cloud_pk'] # noqa: E501
3693+
if 'project_pk' in local_var_params:
3694+
path_params['project_pk'] = local_var_params['project_pk'] # noqa: E501
3695+
3696+
query_params = []
3697+
3698+
header_params = {}
3699+
3700+
form_params = []
3701+
local_var_files = {}
3702+
3703+
body_params = None
3704+
if 'data' in local_var_params:
3705+
body_params = local_var_params['data']
3706+
# HTTP header `Accept`
3707+
header_params['Accept'] = self.api_client.select_header_accept(
3708+
['application/json']) # noqa: E501
3709+
3710+
# HTTP header `Content-Type`
3711+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
3712+
['application/json']) # noqa: E501
3713+
3714+
# Authentication setting
3715+
auth_settings = ['Bearer', 'bimdata_connect', 'client_credentials'] # noqa: E501
3716+
3717+
return self.api_client.call_api(
3718+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/create-model', 'POST',
3719+
path_params,
3720+
query_params,
3721+
header_params,
3722+
body=body_params,
3723+
post_params=form_params,
3724+
files=local_var_files,
3725+
response_type='Ifc', # noqa: E501
3726+
auth_settings=auth_settings,
3727+
async_req=local_var_params.get('async_req'),
3728+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
3729+
_preload_content=local_var_params.get('_preload_content', True),
3730+
_request_timeout=local_var_params.get('_request_timeout'),
3731+
collection_formats=collection_formats)
3732+
35973733
def create_property_set(self, cloud_pk, ifc_pk, project_pk, data, **kwargs): # noqa: E501
35983734
"""Create a PropertySet # noqa: E501
35993735

@@ -4887,7 +5023,7 @@ def delete_element_with_http_info(self, cloud_pk, ifc_pk, project_pk, uuid, **kw
48875023
def delete_ifc(self, cloud_pk, id, project_pk, **kwargs): # noqa: E501
48885024
"""Delete a model # noqa: E501
48895025

4890-
It will delete the related document too Required scopes: ifc:write # noqa: E501
5026+
It will also delete the related document Required scopes: ifc:write # noqa: E501
48915027
This method makes a synchronous HTTP request by default. To make an
48925028
asynchronous HTTP request, please pass async_req=True
48935029
>>> thread = api.delete_ifc(cloud_pk, id, project_pk, async_req=True)
@@ -4914,7 +5050,7 @@ def delete_ifc(self, cloud_pk, id, project_pk, **kwargs): # noqa: E501
49145050
def delete_ifc_with_http_info(self, cloud_pk, id, project_pk, **kwargs): # noqa: E501
49155051
"""Delete a model # noqa: E501
49165052

4917-
It will delete the related document too Required scopes: ifc:write # noqa: E501
5053+
It will also delete the related document Required scopes: ifc:write # noqa: E501
49185054
This method makes a synchronous HTTP request by default. To make an
49195055
asynchronous HTTP request, please pass async_req=True
49205056
>>> thread = api.delete_ifc_with_http_info(cloud_pk, id, project_pk, async_req=True)
@@ -5560,6 +5696,134 @@ def delete_layer_with_http_info(self, cloud_pk, id, ifc_pk, project_pk, **kwargs
55605696
_request_timeout=local_var_params.get('_request_timeout'),
55615697
collection_formats=collection_formats)
55625698

5699+
def delete_model_without_doc(self, cloud_pk, id, project_pk, **kwargs): # noqa: E501
5700+
"""Delete the Model without deleting the related document # noqa: E501
5701+
5702+
Delete the Model without deleting the related document Required scopes: ifc:write # noqa: E501
5703+
This method makes a synchronous HTTP request by default. To make an
5704+
asynchronous HTTP request, please pass async_req=True
5705+
>>> thread = api.delete_model_without_doc(cloud_pk, id, project_pk, async_req=True)
5706+
>>> result = thread.get()
5707+
5708+
:param async_req bool: execute request asynchronously
5709+
:param str cloud_pk: (required)
5710+
:param int id: A unique integer value identifying this ifc. (required)
5711+
:param str project_pk: (required)
5712+
:param _preload_content: if False, the urllib3.HTTPResponse object will
5713+
be returned without reading/decoding response
5714+
data. Default is True.
5715+
:param _request_timeout: timeout setting for this request. If one
5716+
number provided, it will be total request
5717+
timeout. It can also be a pair (tuple) of
5718+
(connection, read) timeouts.
5719+
:return: None
5720+
If the method is called asynchronously,
5721+
returns the request thread.
5722+
"""
5723+
kwargs['_return_http_data_only'] = True
5724+
return self.delete_model_without_doc_with_http_info(cloud_pk, id, project_pk, **kwargs) # noqa: E501
5725+
5726+
def delete_model_without_doc_with_http_info(self, cloud_pk, id, project_pk, **kwargs): # noqa: E501
5727+
"""Delete the Model without deleting the related document # noqa: E501
5728+
5729+
Delete the Model without deleting the related document Required scopes: ifc:write # noqa: E501
5730+
This method makes a synchronous HTTP request by default. To make an
5731+
asynchronous HTTP request, please pass async_req=True
5732+
>>> thread = api.delete_model_without_doc_with_http_info(cloud_pk, id, project_pk, async_req=True)
5733+
>>> result = thread.get()
5734+
5735+
:param async_req bool: execute request asynchronously
5736+
:param str cloud_pk: (required)
5737+
:param int id: A unique integer value identifying this ifc. (required)
5738+
:param str project_pk: (required)
5739+
:param _return_http_data_only: response data without head status code
5740+
and headers
5741+
:param _preload_content: if False, the urllib3.HTTPResponse object will
5742+
be returned without reading/decoding response
5743+
data. Default is True.
5744+
:param _request_timeout: timeout setting for this request. If one
5745+
number provided, it will be total request
5746+
timeout. It can also be a pair (tuple) of
5747+
(connection, read) timeouts.
5748+
:return: None
5749+
If the method is called asynchronously,
5750+
returns the request thread.
5751+
"""
5752+
5753+
local_var_params = locals()
5754+
5755+
all_params = [
5756+
'cloud_pk',
5757+
'id',
5758+
'project_pk'
5759+
]
5760+
all_params.extend(
5761+
[
5762+
'async_req',
5763+
'_return_http_data_only',
5764+
'_preload_content',
5765+
'_request_timeout'
5766+
]
5767+
)
5768+
5769+
for key, val in six.iteritems(local_var_params['kwargs']):
5770+
if key not in all_params:
5771+
raise ApiTypeError(
5772+
"Got an unexpected keyword argument '%s'"
5773+
" to method delete_model_without_doc" % key
5774+
)
5775+
local_var_params[key] = val
5776+
del local_var_params['kwargs']
5777+
# verify the required parameter 'cloud_pk' is set
5778+
if self.api_client.client_side_validation and ('cloud_pk' not in local_var_params or # noqa: E501
5779+
local_var_params['cloud_pk'] is None): # noqa: E501
5780+
raise ApiValueError("Missing the required parameter `cloud_pk` when calling `delete_model_without_doc`") # noqa: E501
5781+
# verify the required parameter 'id' is set
5782+
if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
5783+
local_var_params['id'] is None): # noqa: E501
5784+
raise ApiValueError("Missing the required parameter `id` when calling `delete_model_without_doc`") # noqa: E501
5785+
# verify the required parameter 'project_pk' is set
5786+
if self.api_client.client_side_validation and ('project_pk' not in local_var_params or # noqa: E501
5787+
local_var_params['project_pk'] is None): # noqa: E501
5788+
raise ApiValueError("Missing the required parameter `project_pk` when calling `delete_model_without_doc`") # noqa: E501
5789+
5790+
collection_formats = {}
5791+
5792+
path_params = {}
5793+
if 'cloud_pk' in local_var_params:
5794+
path_params['cloud_pk'] = local_var_params['cloud_pk'] # noqa: E501
5795+
if 'id' in local_var_params:
5796+
path_params['id'] = local_var_params['id'] # noqa: E501
5797+
if 'project_pk' in local_var_params:
5798+
path_params['project_pk'] = local_var_params['project_pk'] # noqa: E501
5799+
5800+
query_params = []
5801+
5802+
header_params = {}
5803+
5804+
form_params = []
5805+
local_var_files = {}
5806+
5807+
body_params = None
5808+
# Authentication setting
5809+
auth_settings = ['Bearer', 'bimdata_connect', 'client_credentials'] # noqa: E501
5810+
5811+
return self.api_client.call_api(
5812+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/delete-model', 'DELETE',
5813+
path_params,
5814+
query_params,
5815+
header_params,
5816+
body=body_params,
5817+
post_params=form_params,
5818+
files=local_var_files,
5819+
response_type=None, # noqa: E501
5820+
auth_settings=auth_settings,
5821+
async_req=local_var_params.get('async_req'),
5822+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
5823+
_preload_content=local_var_params.get('_preload_content', True),
5824+
_request_timeout=local_var_params.get('_request_timeout'),
5825+
collection_formats=collection_formats)
5826+
55635827
def delete_property_set(self, cloud_pk, id, ifc_pk, project_pk, **kwargs): # noqa: E501
55645828
"""Delete a PropertySet of a model # noqa: E501
55655829

bimdata_api_client/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from bimdata_api_client.models.comment import Comment
2828
from bimdata_api_client.models.component import Component
2929
from bimdata_api_client.models.components_parent import ComponentsParent
30+
from bimdata_api_client.models.create_model import CreateModel
3031
from bimdata_api_client.models.direction import Direction
3132
from bimdata_api_client.models.document import Document
3233
from bimdata_api_client.models.document_with_element_list import DocumentWithElementList

0 commit comments

Comments
 (0)