Skip to content

Commit ce78abd

Browse files
committed
MINOR: add document-preview (#642)
* add document-preview * add admin reprocess * rename field
1 parent b79cb7c commit ce78abd

21 files changed

Lines changed: 627 additions & 56 deletions

‎.openapi-generator/FILES‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ bimdata_api_client/model/detailed_extensions.py
5050
bimdata_api_client/model/direction.py
5151
bimdata_api_client/model/direction_request.py
5252
bimdata_api_client/model/document.py
53+
bimdata_api_client/model/document_preview_file.py
5354
bimdata_api_client/model/document_with_element_list.py
5455
bimdata_api_client/model/element.py
5556
bimdata_api_client/model/element_classification_relation.py
@@ -304,6 +305,7 @@ docs/DetailedExtensions.md
304305
docs/Direction.md
305306
docs/DirectionRequest.md
306307
docs/Document.md
308+
docs/DocumentPreviewFile.md
307309
docs/DocumentWithElementList.md
308310
docs/Element.md
309311
docs/ElementClassificationRelation.md
@@ -563,6 +565,7 @@ test/test_detailed_extensions.py
563565
test/test_direction.py
564566
test/test_direction_request.py
565567
test/test_document.py
568+
test/test_document_preview_file.py
566569
test/test_document_with_element_list.py
567570
test/test_element.py
568571
test/test_element_classification_relation.py

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ Class | Method | HTTP request | Description
343343
*CollaborationApi* | [**update_folder**](docs/CollaborationApi.md#update_folder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{id} | Update some fields of a folder
344344
*CollaborationApi* | [**update_group_folder**](docs/CollaborationApi.md#update_group_folder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{folder_pk}/group/{id} | Update the permission of a group on a folder. When propagate is set to True, the permission of all children in the folder will be updated.
345345
*CollaborationApi* | [**update_manage_group**](docs/CollaborationApi.md#update_manage_group) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/group/{id} | Update some fields of a group
346+
*CollaborationApi* | [**update_preview_file**](docs/CollaborationApi.md#update_preview_file) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{id}/preview-file | Update preview of the document
346347
*CollaborationApi* | [**update_project**](docs/CollaborationApi.md#update_project) | **PATCH** /cloud/{cloud_pk}/project/{id} | Update some fields of a project
347348
*CollaborationApi* | [**update_project_access_token**](docs/CollaborationApi.md#update_project_access_token) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/access-token/{token} | Update some fields of a token
348349
*CollaborationApi* | [**update_project_user**](docs/CollaborationApi.md#update_project_user) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/user/{id} | Change the user role in the cloud
@@ -702,6 +703,7 @@ Class | Method | HTTP request | Description
702703
- [Direction](docs/Direction.md)
703704
- [DirectionRequest](docs/DirectionRequest.md)
704705
- [Document](docs/Document.md)
706+
- [DocumentPreviewFile](docs/DocumentPreviewFile.md)
705707
- [DocumentWithElementList](docs/DocumentWithElementList.md)
706708
- [Element](docs/Element.md)
707709
- [ElementClassificationRelation](docs/ElementClassificationRelation.md)

‎bimdata_api_client/api/collaboration_api.py‎

Lines changed: 163 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from bimdata_api_client.model.cloud_invitation_request import CloudInvitationRequest
3131
from bimdata_api_client.model.cloud_request import CloudRequest
3232
from bimdata_api_client.model.document import Document
33+
from bimdata_api_client.model.document_preview_file import DocumentPreviewFile
3334
from bimdata_api_client.model.folder import Folder
3435
from bimdata_api_client.model.folder_user_project import FolderUserProject
3536
from bimdata_api_client.model.folder_without_children import FolderWithoutChildren
@@ -944,7 +945,6 @@ def __init__(self, api_client=None):
944945
'parent_id',
945946
'file_name',
946947
'description',
947-
'size',
948948
'model_source',
949949
'ifc_source',
950950
'successor_of',
@@ -958,7 +958,6 @@ def __init__(self, api_client=None):
958958
'nullable': [
959959
'parent_id',
960960
'description',
961-
'size',
962961
],
963962
'enum': [
964963
'model_source',
@@ -967,7 +966,6 @@ def __init__(self, api_client=None):
967966
'validation': [
968967
'name',
969968
'file_name',
970-
'size',
971969
]
972970
},
973971
root_map={
@@ -980,11 +978,6 @@ def __init__(self, api_client=None):
980978
'max_length': 512,
981979
'min_length': 1,
982980
},
983-
('size',): {
984-
985-
'inclusive_maximum': 9223372036854775807,
986-
'inclusive_minimum': 0,
987-
},
988981
},
989982
'allowed_values': {
990983
('model_source',): {
@@ -1019,8 +1012,6 @@ def __init__(self, api_client=None):
10191012
(str,),
10201013
'description':
10211014
(str, none_type,),
1022-
'size':
1023-
(int, none_type,),
10241015
'model_source':
10251016
(str,),
10261017
'ifc_source':
@@ -1036,7 +1027,6 @@ def __init__(self, api_client=None):
10361027
'parent_id': 'parent_id',
10371028
'file_name': 'file_name',
10381029
'description': 'description',
1039-
'size': 'size',
10401030
'model_source': 'model_source',
10411031
'ifc_source': 'ifc_source',
10421032
'successor_of': 'successor_of',
@@ -1049,7 +1039,6 @@ def __init__(self, api_client=None):
10491039
'parent_id': 'form',
10501040
'file_name': 'form',
10511041
'description': 'form',
1052-
'size': 'form',
10531042
'model_source': 'form',
10541043
'ifc_source': 'form',
10551044
'successor_of': 'form',
@@ -6589,6 +6578,80 @@ def __init__(self, api_client=None):
65896578
},
65906579
api_client=api_client
65916580
)
6581+
self.update_preview_file_endpoint = _Endpoint(
6582+
settings={
6583+
'response_type': (DocumentPreviewFile,),
6584+
'auth': [
6585+
'ApiKey',
6586+
'BIMData_Connect',
6587+
'BIMData_Connect',
6588+
'Bearer'
6589+
],
6590+
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/document/{id}/preview-file',
6591+
'operation_id': 'update_preview_file',
6592+
'http_method': 'PATCH',
6593+
'servers': None,
6594+
},
6595+
params_map={
6596+
'all': [
6597+
'cloud_pk',
6598+
'id',
6599+
'project_pk',
6600+
'office_preview',
6601+
],
6602+
'required': [
6603+
'cloud_pk',
6604+
'id',
6605+
'project_pk',
6606+
],
6607+
'nullable': [
6608+
],
6609+
'enum': [
6610+
],
6611+
'validation': [
6612+
]
6613+
},
6614+
root_map={
6615+
'validations': {
6616+
},
6617+
'allowed_values': {
6618+
},
6619+
'openapi_types': {
6620+
'cloud_pk':
6621+
(int,),
6622+
'id':
6623+
(int,),
6624+
'project_pk':
6625+
(int,),
6626+
'office_preview':
6627+
(file_type,),
6628+
},
6629+
'attribute_map': {
6630+
'cloud_pk': 'cloud_pk',
6631+
'id': 'id',
6632+
'project_pk': 'project_pk',
6633+
'office_preview': 'office_preview',
6634+
},
6635+
'location_map': {
6636+
'cloud_pk': 'path',
6637+
'id': 'path',
6638+
'project_pk': 'path',
6639+
'office_preview': 'form',
6640+
},
6641+
'collection_format_map': {
6642+
}
6643+
},
6644+
headers_map={
6645+
'accept': [
6646+
'application/json'
6647+
],
6648+
'content_type': [
6649+
'multipart/form-data',
6650+
'application/x-www-form-urlencoded'
6651+
]
6652+
},
6653+
api_client=api_client
6654+
)
65926655
self.update_project_endpoint = _Endpoint(
65936656
settings={
65946657
'response_type': (Project,),
@@ -8240,7 +8303,7 @@ def create_document(
82408303
):
82418304
"""Create a document # noqa: E501
82428305

8243-
Create a document. If the document is one of {'POINT_CLOUD', 'DAE', 'GLTF', 'IFC', 'OBJ', 'DWG', 'BFX', 'DXF'}, 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 {'OBJ', 'IFC', 'DWG', 'POINT_CLOUD', 'GLTF', 'DXF'}, a model will be created and attached to this document Required scopes: document:write # noqa: E501
82448307
This method makes a synchronous HTTP request by default. To make an
82458308
asynchronous HTTP request, please pass async_req=True
82468309

@@ -8257,7 +8320,6 @@ def create_document(
82578320
parent_id (int, none_type): [optional]
82588321
file_name (str): Full name of the file. [optional]
82598322
description (str, none_type): Description of the file. [optional]
8260-
size (int, none_type): Size of the file.. [optional]
82618323
model_source (str): Define the model.source field if the upload is a Model (IFC, PDF, DWG...). [optional]
82628324
ifc_source (str): DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...). [optional]
82638325
successor_of (int): Old document version to replace. Only for create. [optional]
@@ -15530,6 +15592,93 @@ def update_manage_group(
1553015592
project_pk
1553115593
return self.update_manage_group_endpoint.call_with_http_info(**kwargs)
1553215594

15595+
def update_preview_file(
15596+
self,
15597+
cloud_pk,
15598+
id,
15599+
project_pk,
15600+
**kwargs
15601+
):
15602+
"""Update preview of the document # noqa: E501
15603+
15604+
Update preview of the document Required scopes: document:write # noqa: E501
15605+
This method makes a synchronous HTTP request by default. To make an
15606+
asynchronous HTTP request, please pass async_req=True
15607+
15608+
>>> thread = api.update_preview_file(cloud_pk, id, project_pk, async_req=True)
15609+
>>> result = thread.get()
15610+
15611+
Args:
15612+
cloud_pk (int): A unique integer value identifying this cloud.
15613+
id (int): A unique integer value identifying this document.
15614+
project_pk (int): A unique integer value identifying this project.
15615+
15616+
Keyword Args:
15617+
office_preview (file_type): Office files will be converted as pdf to provide a web preview. Supported extensions are .ppt, .pptx, .odp, .xls, .xlsx, .ods, .doc, .docx, .odt. [optional]
15618+
_return_http_data_only (bool): response data without head status
15619+
code and headers. Default is True.
15620+
_preload_content (bool): if False, the urllib3.HTTPResponse object
15621+
will be returned without reading/decoding response data.
15622+
Default is True.
15623+
_request_timeout (int/float/tuple): timeout setting for this request. If
15624+
one number provided, it will be total request timeout. It can also
15625+
be a pair (tuple) of (connection, read) timeouts.
15626+
Default is None.
15627+
_check_input_type (bool): specifies if type checking
15628+
should be done one the data sent to the server.
15629+
Default is True.
15630+
_check_return_type (bool): specifies if type checking
15631+
should be done one the data received from the server.
15632+
Default is True.
15633+
_spec_property_naming (bool): True if the variable names in the input data
15634+
are serialized names, as specified in the OpenAPI document.
15635+
False if the variable names in the input data
15636+
are pythonic names, e.g. snake case (default)
15637+
_content_type (str/None): force body content-type.
15638+
Default is None and content-type will be predicted by allowed
15639+
content-types and body.
15640+
_host_index (int/None): specifies the index of the server
15641+
that we want to use.
15642+
Default is read from the configuration.
15643+
async_req (bool): execute request asynchronously
15644+
15645+
Returns:
15646+
DocumentPreviewFile
15647+
If the method is called asynchronously, returns the request
15648+
thread.
15649+
"""
15650+
kwargs['async_req'] = kwargs.get(
15651+
'async_req', False
15652+
)
15653+
kwargs['_return_http_data_only'] = kwargs.get(
15654+
'_return_http_data_only', True
15655+
)
15656+
kwargs['_preload_content'] = kwargs.get(
15657+
'_preload_content', True
15658+
)
15659+
kwargs['_request_timeout'] = kwargs.get(
15660+
'_request_timeout', None
15661+
)
15662+
kwargs['_check_input_type'] = kwargs.get(
15663+
'_check_input_type', True
15664+
)
15665+
kwargs['_check_return_type'] = kwargs.get(
15666+
'_check_return_type', True
15667+
)
15668+
kwargs['_spec_property_naming'] = kwargs.get(
15669+
'_spec_property_naming', False
15670+
)
15671+
kwargs['_content_type'] = kwargs.get(
15672+
'_content_type')
15673+
kwargs['_host_index'] = kwargs.get('_host_index')
15674+
kwargs['cloud_pk'] = \
15675+
cloud_pk
15676+
kwargs['id'] = \
15677+
id
15678+
kwargs['project_pk'] = \
15679+
project_pk
15680+
return self.update_preview_file_endpoint.call_with_http_info(**kwargs)
15681+
1553315682
def update_project(
1553415683
self,
1553515684
cloud_pk,

‎bimdata_api_client/api/ifc_api.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7291,8 +7291,6 @@ def __init__(self, api_client=None):
72917291
},
72927292
('type',): {
72937293

7294-
"BFX": "BFX",
7295-
"DAE": "DAE",
72967294
"DWG": "DWG",
72977295
"DXF": "DXF",
72987296
"GLTF": "GLTF",

‎bimdata_api_client/api/model_api.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6985,8 +6985,6 @@ def __init__(self, api_client=None):
69856985
},
69866986
('type',): {
69876987

6988-
"BFX": "BFX",
6989-
"DAE": "DAE",
69906988
"DWG": "DWG",
69916989
"DXF": "DXF",
69926990
"GLTF": "GLTF",

0 commit comments

Comments
 (0)