Skip to content

Commit

Permalink
MINOR: Bcf odata (#772)
Browse files Browse the repository at this point in the history
* implement odata filters

* add orderby

* factorize

* replace test domains with bimdata.test
  • Loading branch information
Bimdata-io committed Sep 16, 2024
1 parent 6573cae commit 3f7b96a
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 24 deletions.
18 changes: 16 additions & 2 deletions docs/BcfApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ Name | Type | Description | Notes

## getComments

> [Comment] getComments(projectsPk, topicsGuid)
> [Comment] getComments(projectsPk, topicsGuid, opts)
Retrieve all comments

Expand Down Expand Up @@ -2105,7 +2105,11 @@ Bearer.apiKey = 'YOUR API KEY';
let apiInstance = new bimdata.BcfApi();
let projectsPk = 56; // Number | A unique integer value identifying this project.
let topicsGuid = "topicsGuid_example"; // String |
apiInstance.getComments(projectsPk, topicsGuid).then((data) => {
let opts = {
'filter': "filter_example", // String | OData filters as defined in BCF spec
'orderby': "orderby_example" // String | OData orderby as defined in BCF spec
};
apiInstance.getComments(projectsPk, topicsGuid, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
Expand All @@ -2120,6 +2124,8 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**projectsPk** | **Number**| A unique integer value identifying this project. |
**topicsGuid** | **String**| |
**filter** | **String**| OData filters as defined in BCF spec | [optional]
**orderby** | **String**| OData orderby as defined in BCF spec | [optional]

### Return type

Expand Down Expand Up @@ -2357,6 +2363,8 @@ Bearer.apiKey = 'YOUR API KEY';
let apiInstance = new bimdata.BcfApi();
let projectsPk = 56; // Number |
let opts = {
'filter': "filter_example", // String | OData filters as defined in BCF spec
'orderby': "orderby_example", // String | OData orderby as defined in BCF spec
'format': "format_example", // String |
'ifcs': [null], // [Number] |
'imgFormat': "imgFormat_example", // String | All snapshot_data will be returned as url instead of base64
Expand All @@ -2376,6 +2384,8 @@ apiInstance.getFullTopics(projectsPk, opts).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**projectsPk** | **Number**| |
**filter** | **String**| OData filters as defined in BCF spec | [optional]
**orderby** | **String**| OData orderby as defined in BCF spec | [optional]
**format** | **String**| | [optional]
**ifcs** | [**[Number]**](Number.md)| | [optional]
**imgFormat** | **String**| All snapshot_data will be returned as url instead of base64 | [optional]
Expand Down Expand Up @@ -2895,6 +2905,8 @@ Bearer.apiKey = 'YOUR API KEY';
let apiInstance = new bimdata.BcfApi();
let projectsPk = 56; // Number |
let opts = {
'filter': "filter_example", // String | OData filters as defined in BCF spec
'orderby': "orderby_example", // String | OData orderby as defined in BCF spec
'format': "format_example", // String |
'ifcs': [null], // [Number] |
'models': [null] // [Number] |
Expand All @@ -2913,6 +2925,8 @@ apiInstance.getTopics(projectsPk, opts).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**projectsPk** | **Number**| |
**filter** | **String**| OData filters as defined in BCF spec | [optional]
**orderby** | **String**| OData orderby as defined in BCF spec | [optional]
**format** | **String**| | [optional]
**ifcs** | [**[Number]**](Number.md)| | [optional]
**models** | [**[Number]**](Number.md)| | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/CollaborationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ Name | Type | Description | Notes
Create a document

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

### Example

Expand Down
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
------------ | ------------- | ------------- | -------------
**defaultPermission** | **Number** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
**parentId** | **Number** | | [optional]
**name** | **String** | Name of the folder |
**defaultPermission** | **Number** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
**children** | [**[WriteFolderRequest]**](WriteFolderRequest.md) | | [optional]


Expand Down
27 changes: 24 additions & 3 deletions src/api/BcfApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1879,9 +1879,13 @@ export default class BcfApi {
* Retrieve all comments Required scopes: bcf:read
* @param {Number} projectsPk A unique integer value identifying this project.
* @param {String} topicsGuid
* @param {Object} opts Optional parameters
* @param {String} opts.filter OData filters as defined in BCF spec
* @param {String} opts.orderby OData orderby as defined in BCF spec
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/Comment>} and HTTP response
*/
getCommentsWithHttpInfo(projectsPk, topicsGuid) {
getCommentsWithHttpInfo(projectsPk, topicsGuid, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'projectsPk' is set
if (projectsPk === undefined || projectsPk === null) {
Expand All @@ -1897,6 +1901,8 @@ export default class BcfApi {
'topics_guid': topicsGuid
};
let queryParams = {
'$filter': opts['filter'],
'$orderby': opts['orderby']
};
let headerParams = {
};
Expand All @@ -1919,10 +1925,13 @@ export default class BcfApi {
* Retrieve all comments Required scopes: bcf:read
* @param {Number} projectsPk A unique integer value identifying this project.
* @param {String} topicsGuid
* @param {Object} opts Optional parameters
* @param {String} opts.filter OData filters as defined in BCF spec
* @param {String} opts.orderby OData orderby as defined in BCF spec
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Comment>}
*/
getComments(projectsPk, topicsGuid) {
return this.getCommentsWithHttpInfo(projectsPk, topicsGuid)
getComments(projectsPk, topicsGuid, opts) {
return this.getCommentsWithHttpInfo(projectsPk, topicsGuid, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
Expand Down Expand Up @@ -2091,6 +2100,8 @@ export default class BcfApi {
* This is not a standard route. It responds with all topics, their viewpoints and their comments Required scopes: bcf:read
* @param {Number} projectsPk
* @param {Object} opts Optional parameters
* @param {String} opts.filter OData filters as defined in BCF spec
* @param {String} opts.orderby OData orderby as defined in BCF spec
* @param {String} opts.format
* @param {Array.<Number>} opts.ifcs
* @param {module:model/String} opts.imgFormat All snapshot_data will be returned as url instead of base64
Expand All @@ -2109,6 +2120,8 @@ export default class BcfApi {
'projects_pk': projectsPk
};
let queryParams = {
'$filter': opts['filter'],
'$orderby': opts['orderby'],
'format': opts['format'],
'ifcs': this.apiClient.buildCollectionParam(opts['ifcs'], 'multi'),
'img_format': opts['imgFormat'],
Expand All @@ -2135,6 +2148,8 @@ export default class BcfApi {
* This is not a standard route. It responds with all topics, their viewpoints and their comments Required scopes: bcf:read
* @param {Number} projectsPk
* @param {Object} opts Optional parameters
* @param {String} opts.filter OData filters as defined in BCF spec
* @param {String} opts.orderby OData orderby as defined in BCF spec
* @param {String} opts.format
* @param {Array.<Number>} opts.ifcs
* @param {module:model/String} opts.imgFormat All snapshot_data will be returned as url instead of base64
Expand Down Expand Up @@ -2590,6 +2605,8 @@ export default class BcfApi {
* Retrieve all topics Required scopes: bcf:read
* @param {Number} projectsPk
* @param {Object} opts Optional parameters
* @param {String} opts.filter OData filters as defined in BCF spec
* @param {String} opts.orderby OData orderby as defined in BCF spec
* @param {String} opts.format
* @param {Array.<Number>} opts.ifcs
* @param {Array.<Number>} opts.models
Expand All @@ -2607,6 +2624,8 @@ export default class BcfApi {
'projects_pk': projectsPk
};
let queryParams = {
'$filter': opts['filter'],
'$orderby': opts['orderby'],
'format': opts['format'],
'ifcs': this.apiClient.buildCollectionParam(opts['ifcs'], 'multi'),
'models': this.apiClient.buildCollectionParam(opts['models'], 'multi')
Expand All @@ -2632,6 +2651,8 @@ export default class BcfApi {
* Retrieve all topics Required scopes: bcf:read
* @param {Number} projectsPk
* @param {Object} opts Optional parameters
* @param {String} opts.filter OData filters as defined in BCF spec
* @param {String} opts.orderby OData orderby as defined in BCF spec
* @param {String} opts.format
* @param {Array.<Number>} opts.ifcs
* @param {Array.<Number>} opts.models
Expand Down
4 changes: 2 additions & 2 deletions src/api/CollaborationApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ export default class CollaborationApi {

/**
* Create a document
* Create a document. If the document is one of {'OBJ', 'IFC', 'POINT_CLOUD', 'GLTF', 'DXF', 'DWG'}, a model will be created and attached to this document Required scopes: document:write
* Create a document. If the document is one of {'OBJ', 'GLTF', 'IFC', 'DWG', 'POINT_CLOUD', 'DXF'}, 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 Down Expand Up @@ -933,7 +933,7 @@ export default class CollaborationApi {

/**
* Create a document
* Create a document. If the document is one of {'OBJ', 'IFC', 'POINT_CLOUD', 'GLTF', 'DXF', 'DWG'}, a model will be created and attached to this document Required scopes: document:write
* Create a document. If the document is one of {'OBJ', 'GLTF', 'IFC', 'DWG', 'POINT_CLOUD', 'DXF'}, 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 Down
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('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('default_permission')) {
obj['default_permission'] = ApiClient.convertToType(data['default_permission'], 'Number');
}
if (data.hasOwnProperty('children')) {
obj['children'] = ApiClient.convertToType(data['children'], [WriteFolderRequest]);
}
Expand All @@ -68,6 +68,12 @@ class WriteFolderRequest {

}

/**
* Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write
* @member {module:model/WriteFolderRequest.DefaultPermissionEnum} default_permission
*/
WriteFolderRequest.prototype['default_permission'] = undefined;

/**
* @member {Number} parent_id
*/
Expand All @@ -79,12 +85,6 @@ WriteFolderRequest.prototype['parent_id'] = undefined;
*/
WriteFolderRequest.prototype['name'] = undefined;

/**
* Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write
* @member {module:model/WriteFolderRequest.DefaultPermissionEnum} default_permission
*/
WriteFolderRequest.prototype['default_permission'] = undefined;

/**
* @member {Array.<module:model/WriteFolderRequest>} children
*/
Expand Down
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 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();
});

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();
});
Expand Down

0 comments on commit 3f7b96a

Please sign in to comment.