Skip to content

Commit 1b3009c

Browse files
committed
MINOR: add xkt_files fields to support many xtk versions (#647)
* add xkt_files fields to support many xtk versions * fix xkt_file serialization, add admin, migrate data to XktFile * add unique xkt version constraint
1 parent 4147f75 commit 1b3009c

22 files changed

+989
-37
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ bimdata_api_client/model/visibility_request.py
261261
bimdata_api_client/model/web_hook.py
262262
bimdata_api_client/model/web_hook_request.py
263263
bimdata_api_client/model/write_folder_request.py
264+
bimdata_api_client/model/xkt_file.py
264265
bimdata_api_client/model/zone.py
265266
bimdata_api_client/model/zone_request.py
266267
bimdata_api_client/model/zone_space.py
@@ -520,6 +521,7 @@ docs/WebHook.md
520521
docs/WebHookRequest.md
521522
docs/WebhookApi.md
522523
docs/WriteFolderRequest.md
524+
docs/XktFile.md
523525
docs/Zone.md
524526
docs/ZoneRequest.md
525527
docs/ZoneSpace.md
@@ -780,6 +782,7 @@ test/test_web_hook.py
780782
test/test_web_hook_request.py
781783
test/test_webhook_api.py
782784
test/test_write_folder_request.py
785+
test/test_xkt_file.py
783786
test/test_zone.py
784787
test/test_zone_request.py
785788
test/test_zone_space.py

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ Class | Method | HTTP request | Description
390390
*IfcApi* | [**create_storey_plan_deprecated**](docs/IfcApi.md#create_storey_plan_deprecated) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/storey/{storey_uuid}/plan/add | Create a relation between a 2d model and a storey
391391
*IfcApi* | [**create_system_deprecated**](docs/IfcApi.md#create_system_deprecated) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/system | Create a system in the model
392392
*IfcApi* | [**create_tileset_deprecated**](docs/IfcApi.md#create_tileset_deprecated) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/tileset | Create the tileset of the model and upload all files
393+
*IfcApi* | [**create_xkt_file_deprecated**](docs/IfcApi.md#create_xkt_file_deprecated) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/xkt-file | Create an xkt file for the model. Overrides existing file with same version
393394
*IfcApi* | [**create_zone_deprecated**](docs/IfcApi.md#create_zone_deprecated) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone | Create a zone in the model
394395
*IfcApi* | [**create_zone_space_deprecated**](docs/IfcApi.md#create_zone_space_deprecated) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone/{zone_pk}/space | Create a space in a zone
395396
*IfcApi* | [**delete_access_token_deprecated**](docs/IfcApi.md#delete_access_token_deprecated) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/access_token/{token} | Delete a token
@@ -545,6 +546,7 @@ Class | Method | HTTP request | Description
545546
*ModelApi* | [**create_storey_plan**](docs/ModelApi.md#create_storey_plan) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/storey/{storey_uuid}/plan/add | Create a relation between a 2d model and a storey
546547
*ModelApi* | [**create_system**](docs/ModelApi.md#create_system) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/system | Create a system in the model
547548
*ModelApi* | [**create_tileset**](docs/ModelApi.md#create_tileset) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/tileset | Create the tileset of the model and upload all files
549+
*ModelApi* | [**create_xkt_file**](docs/ModelApi.md#create_xkt_file) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{id}/xkt-file | Create an xkt file for the model. Overrides existing file with same version
548550
*ModelApi* | [**create_zone**](docs/ModelApi.md#create_zone) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/zone | Create a zone in the model
549551
*ModelApi* | [**create_zone_space**](docs/ModelApi.md#create_zone_space) | **POST** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/zone/{zone_pk}/space | Create a space in a zone
550552
*ModelApi* | [**delete_access_token**](docs/ModelApi.md#delete_access_token) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/access_token/{token} | Delete a token
@@ -914,6 +916,7 @@ Class | Method | HTTP request | Description
914916
- [WebHook](docs/WebHook.md)
915917
- [WebHookRequest](docs/WebHookRequest.md)
916918
- [WriteFolderRequest](docs/WriteFolderRequest.md)
919+
- [XktFile](docs/XktFile.md)
917920
- [Zone](docs/Zone.md)
918921
- [ZoneRequest](docs/ZoneRequest.md)
919922
- [ZoneSpace](docs/ZoneSpace.md)

bimdata_api_client/api/collaboration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8303,7 +8303,7 @@ def create_document(
83038303
):
83048304
"""Create a document # noqa: E501
83058305

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

bimdata_api_client/api/ifc_api.py

Lines changed: 188 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
from bimdata_api_client.model.system_request import SystemRequest
9090
from bimdata_api_client.model.unit import Unit
9191
from bimdata_api_client.model.unit_request import UnitRequest
92+
from bimdata_api_client.model.xkt_file import XktFile
9293
from bimdata_api_client.model.zone import Zone
9394
from bimdata_api_client.model.zone_request import ZoneRequest
9495
from bimdata_api_client.model.zone_space import ZoneSpace
@@ -3126,6 +3127,93 @@ def __init__(self, api_client=None):
31263127
},
31273128
api_client=api_client
31283129
)
3130+
self.create_xkt_file_deprecated_endpoint = _Endpoint(
3131+
settings={
3132+
'response_type': (XktFile,),
3133+
'auth': [
3134+
'ApiKey',
3135+
'BIMData_Connect',
3136+
'BIMData_Connect',
3137+
'Bearer'
3138+
],
3139+
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/xkt-file',
3140+
'operation_id': 'create_xkt_file_deprecated',
3141+
'http_method': 'POST',
3142+
'servers': None,
3143+
},
3144+
params_map={
3145+
'all': [
3146+
'cloud_pk',
3147+
'id',
3148+
'project_pk',
3149+
'version',
3150+
'file',
3151+
],
3152+
'required': [
3153+
'cloud_pk',
3154+
'id',
3155+
'project_pk',
3156+
'version',
3157+
'file',
3158+
],
3159+
'nullable': [
3160+
],
3161+
'enum': [
3162+
],
3163+
'validation': [
3164+
'version',
3165+
]
3166+
},
3167+
root_map={
3168+
'validations': {
3169+
('version',): {
3170+
3171+
'inclusive_maximum': 2147483647,
3172+
'inclusive_minimum': 0,
3173+
},
3174+
},
3175+
'allowed_values': {
3176+
},
3177+
'openapi_types': {
3178+
'cloud_pk':
3179+
(int,),
3180+
'id':
3181+
(int,),
3182+
'project_pk':
3183+
(int,),
3184+
'version':
3185+
(int,),
3186+
'file':
3187+
(file_type,),
3188+
},
3189+
'attribute_map': {
3190+
'cloud_pk': 'cloud_pk',
3191+
'id': 'id',
3192+
'project_pk': 'project_pk',
3193+
'version': 'version',
3194+
'file': 'file',
3195+
},
3196+
'location_map': {
3197+
'cloud_pk': 'path',
3198+
'id': 'path',
3199+
'project_pk': 'path',
3200+
'version': 'form',
3201+
'file': 'form',
3202+
},
3203+
'collection_format_map': {
3204+
}
3205+
},
3206+
headers_map={
3207+
'accept': [
3208+
'application/json'
3209+
],
3210+
'content_type': [
3211+
'multipart/form-data',
3212+
'application/x-www-form-urlencoded'
3213+
]
3214+
},
3215+
api_client=api_client
3216+
)
31293217
self.create_zone_deprecated_endpoint = _Endpoint(
31303218
settings={
31313219
'response_type': ([Zone],),
@@ -13206,7 +13294,7 @@ def create_access_token_deprecated(
1320613294
):
1320713295
"""Create a token for this model # noqa: E501
1320813296

13209-
Tokens are read_only by default and are valid 1 day Required scopes: ifc:token_manage, model:token_manage # noqa: E501
13297+
DEPECRATED: Use ProjectAccessToken instead Required scopes: ifc:token_manage, model:token_manage # noqa: E501
1321013298
This method makes a synchronous HTTP request by default. To make an
1321113299
asynchronous HTTP request, please pass async_req=True
1321213300

@@ -15569,6 +15657,100 @@ def create_tileset_deprecated(
1556915657
project_pk
1557015658
return self.create_tileset_deprecated_endpoint.call_with_http_info(**kwargs)
1557115659

15660+
def create_xkt_file_deprecated(
15661+
self,
15662+
cloud_pk,
15663+
id,
15664+
project_pk,
15665+
version,
15666+
file,
15667+
**kwargs
15668+
):
15669+
"""Create an xkt file for the model. Overrides existing file with same version # noqa: E501
15670+
15671+
This route does not accept JSON, only files as x-www-form-urlencoded Required scopes: ifc:write, model:write # noqa: E501
15672+
This method makes a synchronous HTTP request by default. To make an
15673+
asynchronous HTTP request, please pass async_req=True
15674+
15675+
>>> thread = api.create_xkt_file_deprecated(cloud_pk, id, project_pk, version, file, async_req=True)
15676+
>>> result = thread.get()
15677+
15678+
Args:
15679+
cloud_pk (int):
15680+
id (int): A unique integer value identifying this model.
15681+
project_pk (int):
15682+
version (int):
15683+
file (file_type):
15684+
15685+
Keyword Args:
15686+
_return_http_data_only (bool): response data without head status
15687+
code and headers. Default is True.
15688+
_preload_content (bool): if False, the urllib3.HTTPResponse object
15689+
will be returned without reading/decoding response data.
15690+
Default is True.
15691+
_request_timeout (int/float/tuple): timeout setting for this request. If
15692+
one number provided, it will be total request timeout. It can also
15693+
be a pair (tuple) of (connection, read) timeouts.
15694+
Default is None.
15695+
_check_input_type (bool): specifies if type checking
15696+
should be done one the data sent to the server.
15697+
Default is True.
15698+
_check_return_type (bool): specifies if type checking
15699+
should be done one the data received from the server.
15700+
Default is True.
15701+
_spec_property_naming (bool): True if the variable names in the input data
15702+
are serialized names, as specified in the OpenAPI document.
15703+
False if the variable names in the input data
15704+
are pythonic names, e.g. snake case (default)
15705+
_content_type (str/None): force body content-type.
15706+
Default is None and content-type will be predicted by allowed
15707+
content-types and body.
15708+
_host_index (int/None): specifies the index of the server
15709+
that we want to use.
15710+
Default is read from the configuration.
15711+
async_req (bool): execute request asynchronously
15712+
15713+
Returns:
15714+
XktFile
15715+
If the method is called asynchronously, returns the request
15716+
thread.
15717+
"""
15718+
kwargs['async_req'] = kwargs.get(
15719+
'async_req', False
15720+
)
15721+
kwargs['_return_http_data_only'] = kwargs.get(
15722+
'_return_http_data_only', True
15723+
)
15724+
kwargs['_preload_content'] = kwargs.get(
15725+
'_preload_content', True
15726+
)
15727+
kwargs['_request_timeout'] = kwargs.get(
15728+
'_request_timeout', None
15729+
)
15730+
kwargs['_check_input_type'] = kwargs.get(
15731+
'_check_input_type', True
15732+
)
15733+
kwargs['_check_return_type'] = kwargs.get(
15734+
'_check_return_type', True
15735+
)
15736+
kwargs['_spec_property_naming'] = kwargs.get(
15737+
'_spec_property_naming', False
15738+
)
15739+
kwargs['_content_type'] = kwargs.get(
15740+
'_content_type')
15741+
kwargs['_host_index'] = kwargs.get('_host_index')
15742+
kwargs['cloud_pk'] = \
15743+
cloud_pk
15744+
kwargs['id'] = \
15745+
id
15746+
kwargs['project_pk'] = \
15747+
project_pk
15748+
kwargs['version'] = \
15749+
version
15750+
kwargs['file'] = \
15751+
file
15752+
return self.create_xkt_file_deprecated_endpoint.call_with_http_info(**kwargs)
15753+
1557215754
def create_zone_deprecated(
1557315755
self,
1557415756
cloud_pk,
@@ -15764,7 +15946,7 @@ def delete_access_token_deprecated(
1576415946
):
1576515947
"""Delete a token # noqa: E501
1576615948

15767-
Deleting a token will revoke it. Required scopes: ifc:token_manage, model:token_manage # noqa: E501
15949+
DEPECRATED: Use ProjectAccessToken instead Required scopes: ifc:token_manage, model:token_manage # noqa: E501
1576815950
This method makes a synchronous HTTP request by default. To make an
1576915951
asynchronous HTTP request, please pass async_req=True
1577015952

@@ -17666,7 +17848,7 @@ def get_access_token_deprecated(
1766617848
):
1766717849
"""Retrieve one token created for this model # noqa: E501
1766817850

17669-
Retrieve one token created for this model Required scopes: ifc:token_manage, model:token_manage # noqa: E501
17851+
DEPECRATED: Use ProjectAccessToken instead Required scopes: ifc:token_manage, model:token_manage # noqa: E501
1767017852
This method makes a synchronous HTTP request by default. To make an
1767117853
asynchronous HTTP request, please pass async_req=True
1767217854

@@ -17755,7 +17937,7 @@ def get_access_tokens_deprecated(
1775517937
):
1775617938
"""Retrieve all tokens created for this model # noqa: E501
1775717939

17758-
Retrieve all tokens created for this model Required scopes: ifc:token_manage, model:token_manage # noqa: E501
17940+
DEPECRATED: Use ProjectAccessToken instead Required scopes: ifc:token_manage, model:token_manage # noqa: E501
1775917941
This method makes a synchronous HTTP request by default. To make an
1776017942
asynchronous HTTP request, please pass async_req=True
1776117943

@@ -24101,7 +24283,7 @@ def update_access_token_deprecated(
2410124283
):
2410224284
"""Update some fields of a token # noqa: E501
2410324285

24104-
You can update the expiration date or the read_only field Required scopes: ifc:token_manage, model:token_manage # noqa: E501
24286+
DEPECRATED: Use ProjectAccessToken instead Required scopes: ifc:token_manage, model:token_manage # noqa: E501
2410524287
This method makes a synchronous HTTP request by default. To make an
2410624288
asynchronous HTTP request, please pass async_req=True
2410724289

@@ -24858,7 +25040,7 @@ def update_ifc_files_deprecated(
2485825040
map_file (file_type, none_type): [optional]
2485925041
gltf_file (file_type, none_type): [optional]
2486025042
preview_file (file_type, none_type): [optional]
24861-
xkt_file (file_type, none_type): [optional]
25043+
xkt_file (file_type, none_type): DEPRECATED. xkt file url is now in xkt_files field with its version number. [optional]
2486225044
binary_2d_file (file_type, none_type): [optional]
2486325045
_return_http_data_only (bool): response data without head status
2486425046
code and headers. Default is True.

0 commit comments

Comments
 (0)