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 00845c2 commit b2cbf9a
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 27 deletions.
6 changes: 4 additions & 2 deletions docs/CollaborationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,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 @@ -995,7 +995,8 @@ let opts = {
'description': "description_example", // String | Description of the file
'modelSource': "modelSource_example", // String | Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED
'ifcSource': "ifcSource_example", // String | 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
'successorOf': 56 // Number | Old document version to replace. Only for create
'successorOf': 56, // Number | Old document version to replace. Only for create
'processHint': "processHint_example" // String | Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE
};
apiInstance.createDocument(cloudPk, projectPk, name, file, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
Expand All @@ -1020,6 +1021,7 @@ Name | Type | Description | Notes
**modelSource** | **String**| 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]
**ifcSource** | **String**| 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]
**successorOf** | **Number**| Old document version to replace. Only for create | [optional]
**processHint** | **String**| Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE | [optional]

### Return type

Expand Down
4 changes: 2 additions & 2 deletions docs/ModelApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,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 @@ -2772,7 +2772,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
10 changes: 10 additions & 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
**modelSource** | **String** | 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]
**ifcSource** | **String** | 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]
**successorOf** | **Number** | Old document version to replace. Only for create | [optional]
**processHint** | **String** | Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE | [optional]



Expand Down Expand Up @@ -48,3 +49,12 @@ Name | Type | Description | Notes




## Enum: ProcessHintEnum


* `PHOTOSPHERE` (value: `"PHOTOSPHERE"`)




2 changes: 1 addition & 1 deletion docs/WriteFolderRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | Name of the folder |
**defaultPermission** | **Number** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
**parentId** | **Number** | | [optional]
**name** | **String** | Name of the folder |
**children** | [**[WriteFolderRequest]**](WriteFolderRequest.md) | | [optional]


Expand Down
9 changes: 6 additions & 3 deletions src/api/CollaborationApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ export default class CollaborationApi {

/**
* 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
* @param {Number} cloudPk A unique integer value identifying this cloud.
* @param {Number} projectPk A unique integer value identifying this project.
* @param {String} name Shown name of the file
Expand All @@ -878,6 +878,7 @@ export default class CollaborationApi {
* @param {module:model/String} opts.modelSource Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED
* @param {module:model/String} opts.ifcSource 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
* @param {Number} opts.successorOf Old document version to replace. Only for create
* @param {module:model/String} opts.processHint Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Document} and HTTP response
*/
createDocumentWithHttpInfo(cloudPk, projectPk, name, file, opts) {
Expand Down Expand Up @@ -916,7 +917,8 @@ export default class CollaborationApi {
'file': file,
'model_source': opts['modelSource'],
'ifc_source': opts['ifcSource'],
'successor_of': opts['successorOf']
'successor_of': opts['successorOf'],
'process_hint': opts['processHint']
};

let authNames = ['ApiKey', 'BIMData_Connect', 'BIMData_Connect', 'Bearer'];
Expand All @@ -932,7 +934,7 @@ export default class CollaborationApi {

/**
* 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
* @param {Number} cloudPk A unique integer value identifying this cloud.
* @param {Number} projectPk A unique integer value identifying this project.
* @param {String} name Shown name of the file
Expand All @@ -944,6 +946,7 @@ export default class CollaborationApi {
* @param {module:model/String} opts.modelSource Define the model.source field if the upload is a Model (IFC, PDF, DWG...) * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED
* @param {module:model/String} opts.ifcSource 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
* @param {Number} opts.successorOf Old document version to replace. Only for create
* @param {module:model/String} opts.processHint Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Document}
*/
createDocument(cloudPk, projectPk, name, file, opts) {
Expand Down
8 changes: 4 additions & 4 deletions src/api/ModelApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ export default class ModelApi {

/**
* 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
* @param {String} buildingUuid
* @param {Number} cloudPk A unique integer value identifying this cloud.
* @param {Number} modelPk A unique integer value identifying this model.
Expand Down Expand Up @@ -1300,7 +1300,7 @@ export default class ModelApi {

/**
* 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
* @param {String} buildingUuid
* @param {Number} cloudPk A unique integer value identifying this cloud.
* @param {Number} modelPk A unique integer value identifying this model.
Expand Down Expand Up @@ -2805,7 +2805,7 @@ export default class ModelApi {

/**
* 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
* @param {Number} cloudPk A unique integer value identifying this cloud.
* @param {Number} modelPk A unique integer value identifying this model.
* @param {Number} projectPk A unique integer value identifying this project.
Expand Down Expand Up @@ -2862,7 +2862,7 @@ export default class ModelApi {

/**
* 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
* @param {Number} cloudPk A unique integer value identifying this cloud.
* @param {Number} modelPk A unique integer value identifying this model.
* @param {Number} projectPk A unique integer value identifying this project.
Expand Down
24 changes: 24 additions & 0 deletions src/model/PatchedDocumentRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class PatchedDocumentRequest {
if (data.hasOwnProperty('successor_of')) {
obj['successor_of'] = ApiClient.convertToType(data['successor_of'], 'Number');
}
if (data.hasOwnProperty('process_hint')) {
obj['process_hint'] = ApiClient.convertToType(data['process_hint'], 'String');
}
}
return obj;
}
Expand Down Expand Up @@ -124,6 +127,12 @@ PatchedDocumentRequest.prototype['ifc_source'] = undefined;
*/
PatchedDocumentRequest.prototype['successor_of'] = undefined;

/**
* Provide a info about the document in order to customize the way it is processed. * `PHOTOSPHERE` - PHOTOSPHERE
* @member {module:model/PatchedDocumentRequest.ProcessHintEnum} process_hint
*/
PatchedDocumentRequest.prototype['process_hint'] = undefined;




Expand Down Expand Up @@ -206,6 +215,21 @@ PatchedDocumentRequest['IfcSourceEnum'] = {
};


/**
* Allowed values for the <code>process_hint</code> property.
* @enum {String}
* @readonly
*/
PatchedDocumentRequest['ProcessHintEnum'] = {

/**
* value: "PHOTOSPHERE"
* @const
*/
"PHOTOSPHERE": "PHOTOSPHERE"
};



export default PatchedDocumentRequest;

18 changes: 9 additions & 9 deletions src/model/WriteFolderRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ class WriteFolderRequest {
if (data) {
obj = obj || new WriteFolderRequest();

if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('default_permission')) {
obj['default_permission'] = ApiClient.convertToType(data['default_permission'], 'Number');
}
if (data.hasOwnProperty('parent_id')) {
obj['parent_id'] = ApiClient.convertToType(data['parent_id'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('children')) {
obj['children'] = ApiClient.convertToType(data['children'], [WriteFolderRequest]);
}
Expand All @@ -68,6 +68,12 @@ class WriteFolderRequest {

}

/**
* Name of the folder
* @member {String} name
*/
WriteFolderRequest.prototype['name'] = undefined;

/**
* Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write
* @member {module:model/WriteFolderRequest.DefaultPermissionEnum} default_permission
Expand All @@ -79,12 +85,6 @@ WriteFolderRequest.prototype['default_permission'] = undefined;
*/
WriteFolderRequest.prototype['parent_id'] = undefined;

/**
* Name of the folder
* @member {String} name
*/
WriteFolderRequest.prototype['name'] = undefined;

/**
* @member {Array.<module:model/WriteFolderRequest>} children
*/
Expand Down
6 changes: 6 additions & 0 deletions test/model/PatchedDocumentRequest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
//expect(instance).to.be();
});

it('should have the property processHint (base name: "process_hint")', function() {
// uncomment below and update the code to test the property processHint
//var instance = new bimdata.PatchedDocumentRequest();
//expect(instance).to.be();
});

});

}));
12 changes: 6 additions & 6 deletions test/model/WriteFolderRequest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@
//expect(instance).to.be.a(bimdata.WriteFolderRequest);
});

it('should have the property defaultPermission (base name: "default_permission")', function() {
// uncomment below and update the code to test the property defaultPermission
it('should have the property name (base name: "name")', function() {
// uncomment below and update the code to test the property name
//var instance = new bimdata.WriteFolderRequest();
//expect(instance).to.be();
});

it('should have the property parentId (base name: "parent_id")', function() {
// uncomment below and update the code to test the property parentId
it('should have the property defaultPermission (base name: "default_permission")', function() {
// uncomment below and update the code to test the property defaultPermission
//var instance = new bimdata.WriteFolderRequest();
//expect(instance).to.be();
});

it('should have the property name (base name: "name")', function() {
// uncomment below and update the code to test the property name
it('should have the property parentId (base name: "parent_id")', function() {
// uncomment below and update the code to test the property parentId
//var instance = new bimdata.WriteFolderRequest();
//expect(instance).to.be();
});
Expand Down

0 comments on commit b2cbf9a

Please sign in to comment.