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

Commit 491e93a

Browse files
committed
MINOR: add element/documents route
1 parent 2c90e8e commit 491e93a

8 files changed

Lines changed: 324 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ Class | Method | HTTP request | Description
339339
*bimdata.IfcApi* | [**getClassificationsOfElement**](docs/IfcApi.md#getClassificationsOfElement) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/classification | Retrieve all classifications of an element
340340
*bimdata.IfcApi* | [**getDocumentsOfElement**](docs/IfcApi.md#getDocumentsOfElement) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/documents | Retrieve all documents of an element
341341
*bimdata.IfcApi* | [**getElement**](docs/IfcApi.md#getElement) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{uuid} | Retrieve an element of a model
342+
*bimdata.IfcApi* | [**getElementLinkedDocuments**](docs/IfcApi.md#getElementLinkedDocuments) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/documents | Retrieve all documents linked to any element
342343
*bimdata.IfcApi* | [**getElementPropertySet**](docs/IfcApi.md#getElementPropertySet) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{id} | Retrieve a PropertySet of an element
343344
*bimdata.IfcApi* | [**getElementPropertySetProperties**](docs/IfcApi.md#getElementPropertySetProperties) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property | Retrieve all Properties of a PropertySet
344345
*bimdata.IfcApi* | [**getElementPropertySetProperty**](docs/IfcApi.md#getElementPropertySetProperty) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Retrieve a Property of a PropertySet
@@ -436,6 +437,7 @@ Class | Method | HTTP request | Description
436437
- [bimdata.ComponentsParent](docs/ComponentsParent.md)
437438
- [bimdata.Direction](docs/Direction.md)
438439
- [bimdata.Document](docs/Document.md)
440+
- [bimdata.DocumentWithElementList](docs/DocumentWithElementList.md)
439441
- [bimdata.Element](docs/Element.md)
440442
- [bimdata.ElementClassificationRelation](docs/ElementClassificationRelation.md)
441443
- [bimdata.ElementPropertySetRelation](docs/ElementPropertySetRelation.md)

docs/DocumentWithElementList.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# bimdata.DocumentWithElementList
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**document** | [**Document**](Document.md) | | [optional]
8+
**elementIds** | **[Number]** | | [optional] [readonly]
9+
10+

docs/IfcApi.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Method | HTTP request | Description
5454
[**getClassificationsOfElement**](IfcApi.md#getClassificationsOfElement) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/classification | Retrieve all classifications of an element
5555
[**getDocumentsOfElement**](IfcApi.md#getDocumentsOfElement) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/documents | Retrieve all documents of an element
5656
[**getElement**](IfcApi.md#getElement) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{uuid} | Retrieve an element of a model
57+
[**getElementLinkedDocuments**](IfcApi.md#getElementLinkedDocuments) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/documents | Retrieve all documents linked to any element
5758
[**getElementPropertySet**](IfcApi.md#getElementPropertySet) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{id} | Retrieve a PropertySet of an element
5859
[**getElementPropertySetProperties**](IfcApi.md#getElementPropertySetProperties) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property | Retrieve all Properties of a PropertySet
5960
[**getElementPropertySetProperty**](IfcApi.md#getElementPropertySetProperty) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Retrieve a Property of a PropertySet
@@ -3253,6 +3254,74 @@ Name | Type | Description | Notes
32533254
- **Accept**: application/json
32543255

32553256

3257+
## getElementLinkedDocuments
3258+
3259+
> [DocumentWithElementList] getElementLinkedDocuments(cloudPk, ifcPk, projectPk, opts)
3260+
3261+
Retrieve all documents linked to any element
3262+
3263+
Retrieve all documents linked to any element with the list of uuids Required scopes: ifc:read
3264+
3265+
### Example
3266+
3267+
```javascript
3268+
import bimdata from '@bimdata/bimdata-api-client';
3269+
let defaultClient = bimdata.ApiClient.instance;
3270+
// Configure API key authorization: Bearer
3271+
let Bearer = defaultClient.authentications['Bearer'];
3272+
Bearer.apiKey = 'YOUR API KEY';
3273+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
3274+
//Bearer.apiKeyPrefix = 'Token';
3275+
// Configure OAuth2 access token for authorization: bimdata_connect
3276+
let bimdata_connect = defaultClient.authentications['bimdata_connect'];
3277+
bimdata_connect.accessToken = 'YOUR ACCESS TOKEN';
3278+
// Configure OAuth2 access token for authorization: client_credentials
3279+
let client_credentials = defaultClient.authentications['client_credentials'];
3280+
client_credentials.accessToken = 'YOUR ACCESS TOKEN';
3281+
3282+
let apiInstance = new bimdata.IfcApi();
3283+
let cloudPk = "cloudPk_example"; // String |
3284+
let ifcPk = "ifcPk_example"; // String |
3285+
let projectPk = "projectPk_example"; // String |
3286+
let opts = {
3287+
'type': "type_example", // String | Filter the returned list by type
3288+
'classification': "classification_example", // String | Filter the returned list by classification
3289+
'classificationNotation': "classificationNotation_example" // String | Filter the returned list by classification__notation
3290+
};
3291+
apiInstance.getElementLinkedDocuments(cloudPk, ifcPk, projectPk, opts).then((data) => {
3292+
console.log('API called successfully. Returned data: ' + data);
3293+
}, (error) => {
3294+
console.error(error);
3295+
});
3296+
3297+
```
3298+
3299+
### Parameters
3300+
3301+
3302+
Name | Type | Description | Notes
3303+
------------- | ------------- | ------------- | -------------
3304+
**cloudPk** | **String**| |
3305+
**ifcPk** | **String**| |
3306+
**projectPk** | **String**| |
3307+
**type** | **String**| Filter the returned list by type | [optional]
3308+
**classification** | **String**| Filter the returned list by classification | [optional]
3309+
**classificationNotation** | **String**| Filter the returned list by classification__notation | [optional]
3310+
3311+
### Return type
3312+
3313+
[**[DocumentWithElementList]**](DocumentWithElementList.md)
3314+
3315+
### Authorization
3316+
3317+
[Bearer](../README.md#Bearer), [bimdata_connect](../README.md#bimdata_connect), [client_credentials](../README.md#client_credentials)
3318+
3319+
### HTTP request headers
3320+
3321+
- **Content-Type**: Not defined
3322+
- **Accept**: application/json
3323+
3324+
32563325
## getElementPropertySet
32573326

32583327
> PropertySet getElementPropertySet(cloudPk, elementUuid, id, ifcPk, projectPk)

src/api/IfcApi.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import ApiClient from "../ApiClient";
1616
import Classification from '../model/Classification';
1717
import Document from '../model/Document';
18+
import DocumentWithElementList from '../model/DocumentWithElementList';
1819
import Element from '../model/Element';
1920
import ElementClassificationRelation from '../model/ElementClassificationRelation';
2021
import ElementPropertySetRelation from '../model/ElementPropertySetRelation';
@@ -3575,6 +3576,80 @@ export default class IfcApi {
35753576
}
35763577

35773578

3579+
/**
3580+
* Retrieve all documents linked to any element
3581+
* Retrieve all documents linked to any element with the list of uuids Required scopes: ifc:read
3582+
* @param {String} cloudPk
3583+
* @param {String} ifcPk
3584+
* @param {String} projectPk
3585+
* @param {Object} opts Optional parameters
3586+
* @param {String} opts.type Filter the returned list by type
3587+
* @param {String} opts.classification Filter the returned list by classification
3588+
* @param {String} opts.classificationNotation Filter the returned list by classification__notation
3589+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/DocumentWithElementList>} and HTTP response
3590+
*/
3591+
getElementLinkedDocumentsWithHttpInfo(cloudPk, ifcPk, projectPk, opts) {
3592+
opts = opts || {};
3593+
let postBody = null;
3594+
// verify the required parameter 'cloudPk' is set
3595+
if (cloudPk === undefined || cloudPk === null) {
3596+
throw new Error("Missing the required parameter 'cloudPk' when calling getElementLinkedDocuments");
3597+
}
3598+
// verify the required parameter 'ifcPk' is set
3599+
if (ifcPk === undefined || ifcPk === null) {
3600+
throw new Error("Missing the required parameter 'ifcPk' when calling getElementLinkedDocuments");
3601+
}
3602+
// verify the required parameter 'projectPk' is set
3603+
if (projectPk === undefined || projectPk === null) {
3604+
throw new Error("Missing the required parameter 'projectPk' when calling getElementLinkedDocuments");
3605+
}
3606+
3607+
let pathParams = {
3608+
'cloud_pk': cloudPk,
3609+
'ifc_pk': ifcPk,
3610+
'project_pk': projectPk
3611+
};
3612+
let queryParams = {
3613+
'type': opts['type'],
3614+
'classification': opts['classification'],
3615+
'classification__notation': opts['classificationNotation']
3616+
};
3617+
let headerParams = {
3618+
};
3619+
let formParams = {
3620+
};
3621+
3622+
let authNames = ['Bearer', 'bimdata_connect', 'client_credentials'];
3623+
let contentTypes = [];
3624+
let accepts = ['application/json'];
3625+
let returnType = [DocumentWithElementList];
3626+
return this.apiClient.callApi(
3627+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/documents', 'GET',
3628+
pathParams, queryParams, headerParams, formParams, postBody,
3629+
authNames, contentTypes, accepts, returnType, null
3630+
);
3631+
}
3632+
3633+
/**
3634+
* Retrieve all documents linked to any element
3635+
* Retrieve all documents linked to any element with the list of uuids Required scopes: ifc:read
3636+
* @param {String} cloudPk
3637+
* @param {String} ifcPk
3638+
* @param {String} projectPk
3639+
* @param {Object} opts Optional parameters
3640+
* @param {String} opts.type Filter the returned list by type
3641+
* @param {String} opts.classification Filter the returned list by classification
3642+
* @param {String} opts.classificationNotation Filter the returned list by classification__notation
3643+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/DocumentWithElementList>}
3644+
*/
3645+
getElementLinkedDocuments(cloudPk, ifcPk, projectPk, opts) {
3646+
return this.getElementLinkedDocumentsWithHttpInfo(cloudPk, ifcPk, projectPk, opts)
3647+
.then(function(response_and_data) {
3648+
return response_and_data.data;
3649+
});
3650+
}
3651+
3652+
35783653
/**
35793654
* Retrieve a PropertySet of an element
35803655
* Retrieve a PropertySet of an element Required scopes: ifc:read

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Component from './model/Component';
2727
import ComponentsParent from './model/ComponentsParent';
2828
import Direction from './model/Direction';
2929
import Document from './model/Document';
30+
import DocumentWithElementList from './model/DocumentWithElementList';
3031
import Element from './model/Element';
3132
import ElementClassificationRelation from './model/ElementClassificationRelation';
3233
import ElementPropertySetRelation from './model/ElementPropertySetRelation';
@@ -253,6 +254,12 @@ export {
253254
*/
254255
Document,
255256

257+
/**
258+
* The DocumentWithElementList model constructor.
259+
* @property {module:model/DocumentWithElementList}
260+
*/
261+
DocumentWithElementList,
262+
256263
/**
257264
* The Element model constructor.
258265
* @property {module:model/Element}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
* BIMData API
3+
* BIMData API is a tool to interact with your models stored on BIMData’s servers. Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints.
4+
*
5+
* The version of the OpenAPI document: v1
6+
* Contact: support@bimdata.io
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*
12+
*/
13+
14+
import ApiClient from '../ApiClient';
15+
import Document from './Document';
16+
17+
/**
18+
* The DocumentWithElementList model module.
19+
* @module model/DocumentWithElementList
20+
* @version 0.0.0
21+
*/
22+
class DocumentWithElementList {
23+
/**
24+
* Constructs a new <code>DocumentWithElementList</code>.
25+
* @alias module:model/DocumentWithElementList
26+
*/
27+
constructor() {
28+
29+
DocumentWithElementList.initialize(this);
30+
}
31+
32+
/**
33+
* Initializes the fields of this object.
34+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
35+
* Only for internal use.
36+
*/
37+
static initialize(obj) {
38+
}
39+
40+
/**
41+
* Constructs a <code>DocumentWithElementList</code> from a plain JavaScript object, optionally creating a new instance.
42+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
43+
* @param {Object} data The plain JavaScript object bearing properties of interest.
44+
* @param {module:model/DocumentWithElementList} obj Optional instance to populate.
45+
* @return {module:model/DocumentWithElementList} The populated <code>DocumentWithElementList</code> instance.
46+
*/
47+
static constructFromObject(data, obj) {
48+
if (data) {
49+
obj = obj || new DocumentWithElementList();
50+
51+
if (data.hasOwnProperty('document')) {
52+
obj['document'] = Document.constructFromObject(data['document']);
53+
}
54+
if (data.hasOwnProperty('element_ids')) {
55+
obj['element_ids'] = ApiClient.convertToType(data['element_ids'], ['Number']);
56+
}
57+
}
58+
return obj;
59+
}
60+
61+
62+
}
63+
64+
/**
65+
* @member {module:model/Document} document
66+
*/
67+
DocumentWithElementList.prototype['document'] = undefined;
68+
69+
/**
70+
* @member {Array.<Number>} element_ids
71+
*/
72+
DocumentWithElementList.prototype['element_ids'] = undefined;
73+
74+
75+
76+
77+
78+
79+
export default DocumentWithElementList;
80+

test/api/IfcApi.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,16 @@
548548
done();
549549
});
550550
});
551+
describe('getElementLinkedDocuments', function() {
552+
it('should call getElementLinkedDocuments successfully', function(done) {
553+
//uncomment below and update the code to test getElementLinkedDocuments
554+
//instance.getElementLinkedDocuments(function(error) {
555+
// if (error) throw error;
556+
//expect().to.be();
557+
//});
558+
done();
559+
});
560+
});
551561
describe('getElementPropertySet', function() {
552562
it('should call getElementPropertySet successfully', function(done) {
553563
//uncomment below and update the code to test getElementPropertySet
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* BIMData API
3+
* BIMData API is a tool to interact with your models stored on BIMData’s servers. Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints.
4+
*
5+
* The version of the OpenAPI document: v1
6+
* Contact: support@bimdata.io
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*
12+
*/
13+
14+
(function(root, factory) {
15+
if (typeof define === 'function' && define.amd) {
16+
// AMD.
17+
define(['expect.js', process.cwd()+'/src/index'], factory);
18+
} else if (typeof module === 'object' && module.exports) {
19+
// CommonJS-like environments that support module.exports, like Node.
20+
factory(require('expect.js'), require(process.cwd()+'/src/index'));
21+
} else {
22+
// Browser globals (root is window)
23+
factory(root.expect, root.bimdata);
24+
}
25+
}(this, function(expect, bimdata) {
26+
'use strict';
27+
28+
var instance;
29+
30+
beforeEach(function() {
31+
instance = new bimdata.DocumentWithElementList();
32+
});
33+
34+
var getProperty = function(object, getter, property) {
35+
// Use getter method if present; otherwise, get the property directly.
36+
if (typeof object[getter] === 'function')
37+
return object[getter]();
38+
else
39+
return object[property];
40+
}
41+
42+
var setProperty = function(object, setter, property, value) {
43+
// Use setter method if present; otherwise, set the property directly.
44+
if (typeof object[setter] === 'function')
45+
object[setter](value);
46+
else
47+
object[property] = value;
48+
}
49+
50+
describe('DocumentWithElementList', function() {
51+
it('should create an instance of DocumentWithElementList', function() {
52+
// uncomment below and update the code to test DocumentWithElementList
53+
//var instane = new bimdata.DocumentWithElementList();
54+
//expect(instance).to.be.a(bimdata.DocumentWithElementList);
55+
});
56+
57+
it('should have the property document (base name: "document")', function() {
58+
// uncomment below and update the code to test the property document
59+
//var instane = new bimdata.DocumentWithElementList();
60+
//expect(instance).to.be();
61+
});
62+
63+
it('should have the property elementIds (base name: "element_ids")', function() {
64+
// uncomment below and update the code to test the property elementIds
65+
//var instane = new bimdata.DocumentWithElementList();
66+
//expect(instance).to.be();
67+
});
68+
69+
});
70+
71+
}));

0 commit comments

Comments
 (0)