Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit 96546fa

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 edfb063 commit 96546fa

10 files changed

Lines changed: 523 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ Class | Method | HTTP request | Description
313313
*bimdata.IfcApi* | [**createIfcPropertyDefinition**](docs/IfcApi.md#createIfcPropertyDefinition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertydefinition | Create a PropertyDefinition on the model
314314
*bimdata.IfcApi* | [**createIfcUnit**](docs/IfcApi.md#createIfcUnit) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/unit | Create a Unit on a model
315315
*bimdata.IfcApi* | [**createLayer**](docs/IfcApi.md#createLayer) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/layer | Create a layer in the model
316+
*bimdata.IfcApi* | [**createModel**](docs/IfcApi.md#createModel) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/create-model | Make a PDF or Image file a Model
316317
*bimdata.IfcApi* | [**createPropertySet**](docs/IfcApi.md#createPropertySet) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset | Create a PropertySet
317318
*bimdata.IfcApi* | [**createPropertySetElementRelations**](docs/IfcApi.md#createPropertySetElementRelations) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset-element | Create association between PropertySet and element
318319
*bimdata.IfcApi* | [**createRawElements**](docs/IfcApi.md#createRawElements) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/raw | Create elements in an optimized format
@@ -327,6 +328,7 @@ Class | Method | HTTP request | Description
327328
*bimdata.IfcApi* | [**deleteIfcPropertyDefinition**](docs/IfcApi.md#deleteIfcPropertyDefinition) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertydefinition/{id} | Delete a PropertyDefinitions of a model
328329
*bimdata.IfcApi* | [**deleteIfcUnit**](docs/IfcApi.md#deleteIfcUnit) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/unit/{id} | Delete a Unit of a model
329330
*bimdata.IfcApi* | [**deleteLayer**](docs/IfcApi.md#deleteLayer) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/layer/{id} | Delete a layer of a model
331+
*bimdata.IfcApi* | [**deleteModelWithoutDoc**](docs/IfcApi.md#deleteModelWithoutDoc) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/delete-model | Delete the Model without deleting the related document
330332
*bimdata.IfcApi* | [**deletePropertySet**](docs/IfcApi.md#deletePropertySet) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset/{id} | Delete a PropertySet of a model
331333
*bimdata.IfcApi* | [**deleteSpace**](docs/IfcApi.md#deleteSpace) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/space/{id} | Delete a space
332334
*bimdata.IfcApi* | [**deleteSystem**](docs/IfcApi.md#deleteSystem) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/system/{uuid} | Delete a system of a model
@@ -435,6 +437,7 @@ Class | Method | HTTP request | Description
435437
- [bimdata.Comment](docs/Comment.md)
436438
- [bimdata.Component](docs/Component.md)
437439
- [bimdata.ComponentsParent](docs/ComponentsParent.md)
440+
- [bimdata.CreateModel](docs/CreateModel.md)
438441
- [bimdata.Direction](docs/Direction.md)
439442
- [bimdata.Document](docs/Document.md)
440443
- [bimdata.DocumentWithElementList](docs/DocumentWithElementList.md)

docs/CreateModel.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# bimdata.CreateModel
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**documentId** | **Number** | |
8+
9+

docs/Ifc.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,33 @@ Name | Type | Description | Notes
3232

3333

3434

35+
## Enum: TypeEnum
36+
37+
38+
* `IFC` (value: `"IFC"`)
39+
40+
* `DWG` (value: `"DWG"`)
41+
42+
* `DXF` (value: `"DXF"`)
43+
44+
* `GLTF` (value: `"GLTF"`)
45+
46+
* `PDF` (value: `"PDF"`)
47+
48+
* `JPEG` (value: `"JPEG"`)
49+
50+
* `PNG` (value: `"PNG"`)
51+
52+
* `OBJ` (value: `"OBJ"`)
53+
54+
* `DAE` (value: `"DAE"`)
55+
56+
* `BFX` (value: `"BFX"`)
57+
58+
59+
60+
61+
3562
## Enum: SourceEnum
3663

3764

docs/IfcApi.md

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Method | HTTP request | Description
2828
[**createIfcPropertyDefinition**](IfcApi.md#createIfcPropertyDefinition) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertydefinition | Create a PropertyDefinition on the model
2929
[**createIfcUnit**](IfcApi.md#createIfcUnit) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/unit | Create a Unit on a model
3030
[**createLayer**](IfcApi.md#createLayer) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/layer | Create a layer in the model
31+
[**createModel**](IfcApi.md#createModel) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/create-model | Make a PDF or Image file a Model
3132
[**createPropertySet**](IfcApi.md#createPropertySet) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset | Create a PropertySet
3233
[**createPropertySetElementRelations**](IfcApi.md#createPropertySetElementRelations) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset-element | Create association between PropertySet and element
3334
[**createRawElements**](IfcApi.md#createRawElements) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/raw | Create elements in an optimized format
@@ -42,6 +43,7 @@ Method | HTTP request | Description
4243
[**deleteIfcPropertyDefinition**](IfcApi.md#deleteIfcPropertyDefinition) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertydefinition/{id} | Delete a PropertyDefinitions of a model
4344
[**deleteIfcUnit**](IfcApi.md#deleteIfcUnit) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/unit/{id} | Delete a Unit of a model
4445
[**deleteLayer**](IfcApi.md#deleteLayer) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/layer/{id} | Delete a layer of a model
46+
[**deleteModelWithoutDoc**](IfcApi.md#deleteModelWithoutDoc) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/delete-model | Delete the Model without deleting the related document
4547
[**deletePropertySet**](IfcApi.md#deletePropertySet) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset/{id} | Delete a PropertySet of a model
4648
[**deleteSpace**](IfcApi.md#deleteSpace) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/space/{id} | Delete a space
4749
[**deleteSystem**](IfcApi.md#deleteSystem) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/system/{uuid} | Delete a system of a model
@@ -1640,6 +1642,66 @@ Name | Type | Description | Notes
16401642
- **Accept**: application/json
16411643

16421644

1645+
## createModel
1646+
1647+
> Ifc createModel(cloudPk, projectPk, data)
1648+
1649+
Make a PDF or Image file a Model
1650+
1651+
Make a PDF or Image file a Model to be used in BIMData services Required scopes: ifc:write
1652+
1653+
### Example
1654+
1655+
```javascript
1656+
import bimdata from '@bimdata/bimdata-api-client';
1657+
let defaultClient = bimdata.ApiClient.instance;
1658+
// Configure API key authorization: Bearer
1659+
let Bearer = defaultClient.authentications['Bearer'];
1660+
Bearer.apiKey = 'YOUR API KEY';
1661+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
1662+
//Bearer.apiKeyPrefix = 'Token';
1663+
// Configure OAuth2 access token for authorization: bimdata_connect
1664+
let bimdata_connect = defaultClient.authentications['bimdata_connect'];
1665+
bimdata_connect.accessToken = 'YOUR ACCESS TOKEN';
1666+
// Configure OAuth2 access token for authorization: client_credentials
1667+
let client_credentials = defaultClient.authentications['client_credentials'];
1668+
client_credentials.accessToken = 'YOUR ACCESS TOKEN';
1669+
1670+
let apiInstance = new bimdata.IfcApi();
1671+
let cloudPk = "cloudPk_example"; // String |
1672+
let projectPk = "projectPk_example"; // String |
1673+
let data = new bimdata.CreateModel(); // CreateModel |
1674+
apiInstance.createModel(cloudPk, projectPk, data).then((data) => {
1675+
console.log('API called successfully. Returned data: ' + data);
1676+
}, (error) => {
1677+
console.error(error);
1678+
});
1679+
1680+
```
1681+
1682+
### Parameters
1683+
1684+
1685+
Name | Type | Description | Notes
1686+
------------- | ------------- | ------------- | -------------
1687+
**cloudPk** | **String**| |
1688+
**projectPk** | **String**| |
1689+
**data** | [**CreateModel**](CreateModel.md)| |
1690+
1691+
### Return type
1692+
1693+
[**Ifc**](Ifc.md)
1694+
1695+
### Authorization
1696+
1697+
[Bearer](../README.md#Bearer), [bimdata_connect](../README.md#bimdata_connect), [client_credentials](../README.md#client_credentials)
1698+
1699+
### HTTP request headers
1700+
1701+
- **Content-Type**: application/json
1702+
- **Accept**: application/json
1703+
1704+
16431705
## createPropertySet
16441706

16451707
> [PropertySet] createPropertySet(cloudPk, ifcPk, projectPk, data)
@@ -2206,7 +2268,7 @@ null (empty response body)
22062268
22072269
Delete a model
22082270

2209-
It will delete the related document too Required scopes: ifc:write
2271+
It will also delete the related document Required scopes: ifc:write
22102272

22112273
### Example
22122274

@@ -2508,6 +2570,66 @@ null (empty response body)
25082570
- **Accept**: Not defined
25092571

25102572

2573+
## deleteModelWithoutDoc
2574+
2575+
> deleteModelWithoutDoc(cloudPk, id, projectPk)
2576+
2577+
Delete the Model without deleting the related document
2578+
2579+
Delete the Model without deleting the related document Required scopes: ifc:write
2580+
2581+
### Example
2582+
2583+
```javascript
2584+
import bimdata from '@bimdata/bimdata-api-client';
2585+
let defaultClient = bimdata.ApiClient.instance;
2586+
// Configure API key authorization: Bearer
2587+
let Bearer = defaultClient.authentications['Bearer'];
2588+
Bearer.apiKey = 'YOUR API KEY';
2589+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
2590+
//Bearer.apiKeyPrefix = 'Token';
2591+
// Configure OAuth2 access token for authorization: bimdata_connect
2592+
let bimdata_connect = defaultClient.authentications['bimdata_connect'];
2593+
bimdata_connect.accessToken = 'YOUR ACCESS TOKEN';
2594+
// Configure OAuth2 access token for authorization: client_credentials
2595+
let client_credentials = defaultClient.authentications['client_credentials'];
2596+
client_credentials.accessToken = 'YOUR ACCESS TOKEN';
2597+
2598+
let apiInstance = new bimdata.IfcApi();
2599+
let cloudPk = "cloudPk_example"; // String |
2600+
let id = 56; // Number | A unique integer value identifying this ifc.
2601+
let projectPk = "projectPk_example"; // String |
2602+
apiInstance.deleteModelWithoutDoc(cloudPk, id, projectPk).then(() => {
2603+
console.log('API called successfully.');
2604+
}, (error) => {
2605+
console.error(error);
2606+
});
2607+
2608+
```
2609+
2610+
### Parameters
2611+
2612+
2613+
Name | Type | Description | Notes
2614+
------------- | ------------- | ------------- | -------------
2615+
**cloudPk** | **String**| |
2616+
**id** | **Number**| A unique integer value identifying this ifc. |
2617+
**projectPk** | **String**| |
2618+
2619+
### Return type
2620+
2621+
null (empty response body)
2622+
2623+
### Authorization
2624+
2625+
[Bearer](../README.md#Bearer), [bimdata_connect](../README.md#bimdata_connect), [client_credentials](../README.md#client_credentials)
2626+
2627+
### HTTP request headers
2628+
2629+
- **Content-Type**: Not defined
2630+
- **Accept**: Not defined
2631+
2632+
25112633
## deletePropertySet
25122634

25132635
> deletePropertySet(cloudPk, id, ifcPk, projectPk)

src/api/IfcApi.js

Lines changed: 126 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import ApiClient from "../ApiClient";
1616
import Classification from '../model/Classification';
17+
import CreateModel from '../model/CreateModel';
1718
import Document from '../model/Document';
1819
import DocumentWithElementList from '../model/DocumentWithElementList';
1920
import Element from '../model/Element';
@@ -1784,6 +1785,67 @@ export default class IfcApi {
17841785
}
17851786

17861787

1788+
/**
1789+
* Make a PDF or Image file a Model
1790+
* Make a PDF or Image file a Model to be used in BIMData services Required scopes: ifc:write
1791+
* @param {String} cloudPk
1792+
* @param {String} projectPk
1793+
* @param {module:model/CreateModel} data
1794+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Ifc} and HTTP response
1795+
*/
1796+
createModelWithHttpInfo(cloudPk, projectPk, data) {
1797+
let postBody = data;
1798+
// verify the required parameter 'cloudPk' is set
1799+
if (cloudPk === undefined || cloudPk === null) {
1800+
throw new Error("Missing the required parameter 'cloudPk' when calling createModel");
1801+
}
1802+
// verify the required parameter 'projectPk' is set
1803+
if (projectPk === undefined || projectPk === null) {
1804+
throw new Error("Missing the required parameter 'projectPk' when calling createModel");
1805+
}
1806+
// verify the required parameter 'data' is set
1807+
if (data === undefined || data === null) {
1808+
throw new Error("Missing the required parameter 'data' when calling createModel");
1809+
}
1810+
1811+
let pathParams = {
1812+
'cloud_pk': cloudPk,
1813+
'project_pk': projectPk
1814+
};
1815+
let queryParams = {
1816+
};
1817+
let headerParams = {
1818+
};
1819+
let formParams = {
1820+
};
1821+
1822+
let authNames = ['Bearer', 'bimdata_connect', 'client_credentials'];
1823+
let contentTypes = ['application/json'];
1824+
let accepts = ['application/json'];
1825+
let returnType = Ifc;
1826+
return this.apiClient.callApi(
1827+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/create-model', 'POST',
1828+
pathParams, queryParams, headerParams, formParams, postBody,
1829+
authNames, contentTypes, accepts, returnType, null
1830+
);
1831+
}
1832+
1833+
/**
1834+
* Make a PDF or Image file a Model
1835+
* Make a PDF or Image file a Model to be used in BIMData services Required scopes: ifc:write
1836+
* @param {String} cloudPk
1837+
* @param {String} projectPk
1838+
* @param {module:model/CreateModel} data
1839+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Ifc}
1840+
*/
1841+
createModel(cloudPk, projectPk, data) {
1842+
return this.createModelWithHttpInfo(cloudPk, projectPk, data)
1843+
.then(function(response_and_data) {
1844+
return response_and_data.data;
1845+
});
1846+
}
1847+
1848+
17871849
/**
17881850
* Create a PropertySet
17891851
* Bulk create available. You can either post an object or a list of objects. Is you post a list, the response will be a list (in the same order) of created objects or of errors if any If at least one create succeeded, the status code will be 201. If every create failed, the status code we'll be 400 with the list of errors Required scopes: ifc:write
@@ -2407,7 +2469,7 @@ export default class IfcApi {
24072469

24082470
/**
24092471
* Delete a model
2410-
* It will delete the related document too Required scopes: ifc:write
2472+
* It will also delete the related document Required scopes: ifc:write
24112473
* @param {String} cloudPk
24122474
* @param {Number} id A unique integer value identifying this ifc.
24132475
* @param {String} projectPk
@@ -2453,7 +2515,7 @@ export default class IfcApi {
24532515

24542516
/**
24552517
* Delete a model
2456-
* It will delete the related document too Required scopes: ifc:write
2518+
* It will also delete the related document Required scopes: ifc:write
24572519
* @param {String} cloudPk
24582520
* @param {Number} id A unique integer value identifying this ifc.
24592521
* @param {String} projectPk
@@ -2743,6 +2805,68 @@ export default class IfcApi {
27432805
}
27442806

27452807

2808+
/**
2809+
* Delete the Model without deleting the related document
2810+
* Delete the Model without deleting the related document Required scopes: ifc:write
2811+
* @param {String} cloudPk
2812+
* @param {Number} id A unique integer value identifying this ifc.
2813+
* @param {String} projectPk
2814+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
2815+
*/
2816+
deleteModelWithoutDocWithHttpInfo(cloudPk, id, projectPk) {
2817+
let postBody = null;
2818+
// verify the required parameter 'cloudPk' is set
2819+
if (cloudPk === undefined || cloudPk === null) {
2820+
throw new Error("Missing the required parameter 'cloudPk' when calling deleteModelWithoutDoc");
2821+
}
2822+
// verify the required parameter 'id' is set
2823+
if (id === undefined || id === null) {
2824+
throw new Error("Missing the required parameter 'id' when calling deleteModelWithoutDoc");
2825+
}
2826+
// verify the required parameter 'projectPk' is set
2827+
if (projectPk === undefined || projectPk === null) {
2828+
throw new Error("Missing the required parameter 'projectPk' when calling deleteModelWithoutDoc");
2829+
}
2830+
2831+
let pathParams = {
2832+
'cloud_pk': cloudPk,
2833+
'id': id,
2834+
'project_pk': projectPk
2835+
};
2836+
let queryParams = {
2837+
};
2838+
let headerParams = {
2839+
};
2840+
let formParams = {
2841+
};
2842+
2843+
let authNames = ['Bearer', 'bimdata_connect', 'client_credentials'];
2844+
let contentTypes = [];
2845+
let accepts = [];
2846+
let returnType = null;
2847+
return this.apiClient.callApi(
2848+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/{id}/delete-model', 'DELETE',
2849+
pathParams, queryParams, headerParams, formParams, postBody,
2850+
authNames, contentTypes, accepts, returnType, null
2851+
);
2852+
}
2853+
2854+
/**
2855+
* Delete the Model without deleting the related document
2856+
* Delete the Model without deleting the related document Required scopes: ifc:write
2857+
* @param {String} cloudPk
2858+
* @param {Number} id A unique integer value identifying this ifc.
2859+
* @param {String} projectPk
2860+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
2861+
*/
2862+
deleteModelWithoutDoc(cloudPk, id, projectPk) {
2863+
return this.deleteModelWithoutDocWithHttpInfo(cloudPk, id, projectPk)
2864+
.then(function(response_and_data) {
2865+
return response_and_data.data;
2866+
});
2867+
}
2868+
2869+
27462870
/**
27472871
* Delete a PropertySet of a model
27482872
* Delete a PropertySet of a model Required scopes: ifc:write

0 commit comments

Comments
 (0)