Skip to content

Commit

Permalink
PATCH: fix(storey): allow to add photosphere as storey plan + fix pro…
Browse files Browse the repository at this point in the history
…cess_hint on createDocument (#790)

* fix(storey): allow to add photosphere as storey plan

* fix(storey): create STOREY_CHILD_TYPES list + add 'process_hint' to Docuemnt serializer fields
  • Loading branch information
Bimdata-io committed Nov 19, 2024
1 parent f024c41 commit 556b744
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
13 changes: 12 additions & 1 deletion bimdata_api_client/api/collaboration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ def __init__(self, api_client=None):
'model_source',
'ifc_source',
'successor_of',
'process_hint',
],
'required': [
'cloud_pk',
Expand All @@ -976,6 +977,7 @@ def __init__(self, api_client=None):
'enum': [
'model_source',
'ifc_source',
'process_hint',
],
'validation': [
'name',
Expand Down Expand Up @@ -1010,6 +1012,10 @@ def __init__(self, api_client=None):
"EXPORT": "EXPORT",
"OPTIMIZED": "OPTIMIZED"
},
('process_hint',): {

"PHOTOSPHERE": "PHOTOSPHERE"
},
},
'openapi_types': {
'cloud_pk':
Expand All @@ -1032,6 +1038,8 @@ def __init__(self, api_client=None):
(str,),
'successor_of':
(int,),
'process_hint':
(str,),
},
'attribute_map': {
'cloud_pk': 'cloud_pk',
Expand All @@ -1044,6 +1052,7 @@ def __init__(self, api_client=None):
'model_source': 'model_source',
'ifc_source': 'ifc_source',
'successor_of': 'successor_of',
'process_hint': 'process_hint',
},
'location_map': {
'cloud_pk': 'path',
Expand All @@ -1056,6 +1065,7 @@ def __init__(self, api_client=None):
'model_source': 'form',
'ifc_source': 'form',
'successor_of': 'form',
'process_hint': 'form',
},
'collection_format_map': {
}
Expand Down Expand Up @@ -8805,7 +8815,7 @@ def create_document(
):
"""Create a document # noqa: E501

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

Expand All @@ -8825,6 +8835,7 @@ def create_document(
model_source (str): Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED. [optional]
ifc_source (str): DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED. [optional]
successor_of (int): Old document version to replace. Only for create. [optional]
process_hint (str): Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE. [optional] if omitted the server will use the default value of "PHOTOSPHERE"
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down
4 changes: 2 additions & 2 deletions bimdata_api_client/api/model_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13347,7 +13347,7 @@ def create_building_plan(
):
"""Create a relation between a 2d model and a building # noqa: E501

Create a relation between a 2d model and a building. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG') Required scopes: ifc:write, model:write # noqa: E501
Create a relation between a 2d model and a building. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG', 'PHOTOSPHERE') Required scopes: ifc:write, model:write # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down Expand Up @@ -15356,7 +15356,7 @@ def create_storey_plan(
):
"""Create a relation between a 2d model and a storey # noqa: E501

Create a relation between a 2d model and a storey. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG') Required scopes: ifc:write, model:write # noqa: E501
Create a relation between a 2d model and a storey. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG', 'PHOTOSPHERE') Required scopes: ifc:write, model:write # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down
7 changes: 7 additions & 0 deletions bimdata_api_client/model/patched_document_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class PatchedDocumentRequest(ModelNormal):
'EXPORT': "EXPORT",
'OPTIMIZED': "OPTIMIZED",
},
('process_hint',): {
'PHOTOSPHERE': "PHOTOSPHERE",
},
}

validations = {
Expand Down Expand Up @@ -112,6 +115,7 @@ def openapi_types():
'model_source': (str,), # noqa: E501
'ifc_source': (str,), # noqa: E501
'successor_of': (int,), # noqa: E501
'process_hint': (str,), # noqa: E501
}

@cached_property
Expand All @@ -128,6 +132,7 @@ def discriminator():
'model_source': 'model_source', # noqa: E501
'ifc_source': 'ifc_source', # noqa: E501
'successor_of': 'successor_of', # noqa: E501
'process_hint': 'process_hint', # noqa: E501
}

read_only_vars = {
Expand Down Expand Up @@ -179,6 +184,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
model_source (str): Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED. [optional] # noqa: E501
ifc_source (str): DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED. [optional] # noqa: E501
successor_of (int): Old document version to replace. Only for create. [optional] # noqa: E501
process_hint (str): Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE. [optional] if omitted the server will use the default value of "PHOTOSPHERE" # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down Expand Up @@ -268,6 +274,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
model_source (str): Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED. [optional] # noqa: E501
ifc_source (str): DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED. [optional] # noqa: E501
successor_of (int): Old document version to replace. Only for create. [optional] # noqa: E501
process_hint (str): Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE. [optional] if omitted the server will use the default value of "PHOTOSPHERE" # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
9 changes: 6 additions & 3 deletions docs/CollaborationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1481,9 +1481,9 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this project.
write_folder_request = [
WriteFolderRequest(
name="name_example",
default_permission=1,
parent_id=1,
name="name_example",
children=[
WriteFolderRequest(),
],
Expand Down Expand Up @@ -1540,7 +1540,7 @@ Name | Type | Description | Notes

Create a document

Create a document. If the document is one of {'GLTF', 'OBJ', 'IFC', 'DWG', 'DXF', 'POINT_CLOUD'}, a model will be created and attached to this document Required scopes: document:write
Create a document. If the document is one of {'OBJ', 'IFC', 'GLTF', 'DXF', 'POINT_CLOUD', 'DWG'}, a model will be created and attached to this document Required scopes: document:write

### Example

Expand Down Expand Up @@ -1604,6 +1604,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
model_source = "UPLOAD" # str | Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED (optional)
ifc_source = "UPLOAD" # str | DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED (optional)
successor_of = 1 # int | Old document version to replace. Only for create (optional)
process_hint = "PHOTOSPHERE" # str | Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE (optional) if omitted the server will use the default value of "PHOTOSPHERE"

# example passing only required values which don't have defaults set
try:
Expand All @@ -1617,7 +1618,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
# and optional values
try:
# Create a document
api_response = api_instance.create_document(cloud_pk, project_pk, name, file, parent_id=parent_id, file_name=file_name, description=description, model_source=model_source, ifc_source=ifc_source, successor_of=successor_of)
api_response = api_instance.create_document(cloud_pk, project_pk, name, file, parent_id=parent_id, file_name=file_name, description=description, model_source=model_source, ifc_source=ifc_source, successor_of=successor_of, process_hint=process_hint)
pprint(api_response)
except bimdata_api_client.ApiException as e:
print("Exception when calling CollaborationApi->create_document: %s\n" % e)
Expand All @@ -1638,6 +1639,7 @@ Name | Type | Description | Notes
**model_source** | **str**| Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED | [optional]
**ifc_source** | **str**| DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED | [optional]
**successor_of** | **int**| Old document version to replace. Only for create | [optional]
**process_hint** | **str**| Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE | [optional] if omitted the server will use the default value of "PHOTOSPHERE"

### Return type

Expand Down Expand Up @@ -10875,6 +10877,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
model_source="UPLOAD",
ifc_source="UPLOAD",
successor_of=1,
process_hint="PHOTOSPHERE",
) # PatchedDocumentRequest | (optional)

# example passing only required values which don't have defaults set
Expand Down
4 changes: 2 additions & 2 deletions docs/ModelApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ Name | Type | Description | Notes

Create a relation between a 2d model and a building

Create a relation between a 2d model and a building. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG') Required scopes: ifc:write, model:write
Create a relation between a 2d model and a building. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG', 'PHOTOSPHERE') Required scopes: ifc:write, model:write

### Example

Expand Down Expand Up @@ -4942,7 +4942,7 @@ Name | Type | Description | Notes

Create a relation between a 2d model and a storey

Create a relation between a 2d model and a storey. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG') Required scopes: ifc:write, model:write
Create a relation between a 2d model and a storey. The model type must be one of : ('DWG', 'DXF', 'PDF', 'JPEG', 'PNG', 'PHOTOSPHERE') Required scopes: ifc:write, model:write

### Example

Expand Down
1 change: 1 addition & 0 deletions docs/PatchedDocumentRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**model_source** | **str** | Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED | [optional]
**ifc_source** | **str** | DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED | [optional]
**successor_of** | **int** | Old document version to replace. Only for create | [optional]
**process_hint** | **str** | Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE | [optional] if omitted the server will use the default value of "PHOTOSPHERE"
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down

0 comments on commit 556b744

Please sign in to comment.