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

Commit d16b03d

Browse files
committed
MINOR: add createDemo route
1 parent 0018c81 commit d16b03d

File tree

8 files changed

+134
-15
lines changed

8 files changed

+134
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ Class | Method | HTTP request | Description
166166
*bimdata.CheckplanApi* | [**updateRuleset**](docs/CheckplanApi.md#updateRuleset) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/checkplan/{check_plan_pk}/ruleset/{id} |
167167
*bimdata.CloudApi* | [**createCloud**](docs/CloudApi.md#createCloud) | **POST** /cloud |
168168
*bimdata.CloudApi* | [**createCloudUser**](docs/CloudApi.md#createCloudUser) | **POST** /cloud/{cloud_pk}/user |
169+
*bimdata.CloudApi* | [**createDemo**](docs/CloudApi.md#createDemo) | **POST** /cloud/{id}/create-demo |
169170
*bimdata.CloudApi* | [**deleteCloudUser**](docs/CloudApi.md#deleteCloudUser) | **DELETE** /cloud/{cloud_pk}/user/{id} |
170171
*bimdata.CloudApi* | [**fullUpdateCloud**](docs/CloudApi.md#fullUpdateCloud) | **PUT** /cloud/{id} |
171172
*bimdata.CloudApi* | [**fullUpdateCloudUser**](docs/CloudApi.md#fullUpdateCloudUser) | **PUT** /cloud/{cloud_pk}/user/{id} |

docs/CloudApi.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**createCloud**](CloudApi.md#createCloud) | **POST** /cloud |
88
[**createCloudUser**](CloudApi.md#createCloudUser) | **POST** /cloud/{cloud_pk}/user |
9+
[**createDemo**](CloudApi.md#createDemo) | **POST** /cloud/{id}/create-demo |
910
[**deleteCloudUser**](CloudApi.md#deleteCloudUser) | **DELETE** /cloud/{cloud_pk}/user/{id} |
1011
[**fullUpdateCloud**](CloudApi.md#fullUpdateCloud) | **PUT** /cloud/{id} |
1112
[**fullUpdateCloudUser**](CloudApi.md#fullUpdateCloudUser) | **PUT** /cloud/{cloud_pk}/user/{id} |
@@ -105,6 +106,55 @@ Name | Type | Description | Notes
105106

106107
[Bearer](../README.md#Bearer)
107108

109+
### HTTP request headers
110+
111+
- **Content-Type**: application/json
112+
- **Accept**: application/json
113+
114+
<a name="createDemo"></a>
115+
# **createDemo**
116+
> Project createDemo(id, cloud)
117+
118+
119+
120+
Create a demo project with a pre-populated IFC and its data
121+
122+
### Example
123+
```javascript
124+
var bimdata = require('@bimdata/bimdata-api-client');
125+
var defaultClient = bimdata.ApiClient.instance;
126+
// Configure API key authorization: Bearer
127+
var Bearer = defaultClient.authentications['Bearer'];
128+
Bearer.apiKey = 'YOUR API KEY';
129+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
130+
//Bearer.apiKeyPrefix = 'Token';
131+
132+
var apiInstance = new bimdata.CloudApi();
133+
var id = "id_example"; // String |
134+
var cloud = new bimdata.Cloud(); // Cloud |
135+
apiInstance.createDemo(id, cloud).then(function(data) {
136+
console.log('API called successfully. Returned data: ' + data);
137+
}, function(error) {
138+
console.error(error);
139+
});
140+
141+
```
142+
143+
### Parameters
144+
145+
Name | Type | Description | Notes
146+
------------- | ------------- | ------------- | -------------
147+
**id** | **String**| |
148+
**cloud** | [**Cloud**](Cloud.md)| |
149+
150+
### Return type
151+
152+
[**Project**](Project.md)
153+
154+
### Authorization
155+
156+
[Bearer](../README.md#Bearer)
157+
108158
### HTTP request headers
109159

110160
- **Content-Type**: application/json

docs/Document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
1212
**fileName** | **String** | | [optional]
1313
**description** | **String** | | [optional]
1414
**file** | **String** | | [optional]
15-
**size** | **String** | | [optional]
15+
**size** | **Number** | | [optional]
1616
**createdAt** | **Date** | | [optional]
1717
**updatedAt** | **Date** | | [optional]
1818
**ifcId** | **String** | | [optional]

docs/ProjectApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var opts = {
117117
'fileName': "fileName_example", // String |
118118
'description': "description_example", // String |
119119
'file': "/path/to/file", // File |
120-
'size': "size_example", // String |
120+
'size': 56, // Number |
121121
'createdAt': new Date("2013-10-20T19:20:30+01:00"), // Date |
122122
'updatedAt': new Date("2013-10-20T19:20:30+01:00"), // Date |
123123
'ifcId': "ifcId_example" // String |
@@ -145,7 +145,7 @@ Name | Type | Description | Notes
145145
**fileName** | **String**| | [optional]
146146
**description** | **String**| | [optional]
147147
**file** | **File**| | [optional]
148-
**size** | **String**| | [optional]
148+
**size** | **Number**| | [optional]
149149
**createdAt** | **Date**| | [optional]
150150
**updatedAt** | **Date**| | [optional]
151151
**ifcId** | **String**| | [optional]
@@ -632,7 +632,7 @@ var opts = {
632632
'fileName': "fileName_example", // String |
633633
'description': "description_example", // String |
634634
'file': "/path/to/file", // File |
635-
'size': "size_example", // String |
635+
'size': 56, // Number |
636636
'createdAt': new Date("2013-10-20T19:20:30+01:00"), // Date |
637637
'updatedAt': new Date("2013-10-20T19:20:30+01:00"), // Date |
638638
'ifcId': "ifcId_example" // String |
@@ -661,7 +661,7 @@ Name | Type | Description | Notes
661661
**fileName** | **String**| | [optional]
662662
**description** | **String**| | [optional]
663663
**file** | **File**| | [optional]
664-
**size** | **String**| | [optional]
664+
**size** | **Number**| | [optional]
665665
**createdAt** | **Date**| | [optional]
666666
**updatedAt** | **Date**| | [optional]
667667
**ifcId** | **String**| | [optional]

src/api/CloudApi.js

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717
(function(root, factory) {
1818
if (typeof define === 'function' && define.amd) {
1919
// AMD. Register as an anonymous module.
20-
define(['ApiClient', 'model/Cloud', 'model/InviteUser', 'model/User'], factory);
20+
define(['ApiClient', 'model/Cloud', 'model/InviteUser', 'model/Project', 'model/User'], factory);
2121
} else if (typeof module === 'object' && module.exports) {
2222
// CommonJS-like environments that support module.exports, like Node.
23-
module.exports = factory(require('../ApiClient'), require('../model/Cloud'), require('../model/InviteUser'), require('../model/User'));
23+
module.exports = factory(require('../ApiClient'), require('../model/Cloud'), require('../model/InviteUser'), require('../model/Project'), require('../model/User'));
2424
} else {
2525
// Browser globals (root is window)
2626
if (!root.bimdata) {
2727
root.bimdata = {};
2828
}
29-
root.bimdata.CloudApi = factory(root.bimdata.ApiClient, root.bimdata.Cloud, root.bimdata.InviteUser, root.bimdata.User);
29+
root.bimdata.CloudApi = factory(root.bimdata.ApiClient, root.bimdata.Cloud, root.bimdata.InviteUser, root.bimdata.Project, root.bimdata.User);
3030
}
31-
}(this, function(ApiClient, Cloud, InviteUser, User) {
31+
}(this, function(ApiClient, Cloud, InviteUser, Project, User) {
3232
'use strict';
3333

3434
/**
@@ -153,6 +153,64 @@
153153
}
154154

155155

156+
/**
157+
* Create a demo project with a pre-populated IFC and its data
158+
* @param {String} id
159+
* @param {module:model/Cloud} cloud
160+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Project} and HTTP response
161+
*/
162+
this.createDemoWithHttpInfo = function(id, cloud) {
163+
var postBody = cloud;
164+
165+
// verify the required parameter 'id' is set
166+
if (id === undefined || id === null) {
167+
throw new Error("Missing the required parameter 'id' when calling createDemo");
168+
}
169+
170+
// verify the required parameter 'cloud' is set
171+
if (cloud === undefined || cloud === null) {
172+
throw new Error("Missing the required parameter 'cloud' when calling createDemo");
173+
}
174+
175+
176+
var pathParams = {
177+
'id': id
178+
};
179+
var queryParams = {
180+
};
181+
var collectionQueryParams = {
182+
};
183+
var headerParams = {
184+
};
185+
var formParams = {
186+
};
187+
188+
var authNames = ['Bearer'];
189+
var contentTypes = ['application/json'];
190+
var accepts = ['application/json'];
191+
var returnType = Project;
192+
193+
return this.apiClient.callApi(
194+
'/cloud/{id}/create-demo', 'POST',
195+
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
196+
authNames, contentTypes, accepts, returnType
197+
);
198+
}
199+
200+
/**
201+
* Create a demo project with a pre-populated IFC and its data
202+
* @param {String} id
203+
* @param {module:model/Cloud} cloud
204+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Project}
205+
*/
206+
this.createDemo = function(id, cloud) {
207+
return this.createDemoWithHttpInfo(id, cloud)
208+
.then(function(response_and_data) {
209+
return response_and_data.data;
210+
});
211+
}
212+
213+
156214
/**
157215
* @param {String} cloudPk
158216
* @param {String} id

src/api/ProjectApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
* @param {String} opts.fileName
129129
* @param {String} opts.description
130130
* @param {File} opts.file
131-
* @param {String} opts.size
131+
* @param {Number} opts.size
132132
* @param {Date} opts.createdAt
133133
* @param {Date} opts.updatedAt
134134
* @param {String} opts.ifcId
@@ -205,7 +205,7 @@
205205
* @param {String} opts.fileName
206206
* @param {String} opts.description
207207
* @param {File} opts.file
208-
* @param {String} opts.size
208+
* @param {Number} opts.size
209209
* @param {Date} opts.createdAt
210210
* @param {Date} opts.updatedAt
211211
* @param {String} opts.ifcId
@@ -806,7 +806,7 @@
806806
* @param {String} opts.fileName
807807
* @param {String} opts.description
808808
* @param {File} opts.file
809-
* @param {String} opts.size
809+
* @param {Number} opts.size
810810
* @param {Date} opts.createdAt
811811
* @param {Date} opts.updatedAt
812812
* @param {String} opts.ifcId
@@ -890,7 +890,7 @@
890890
* @param {String} opts.fileName
891891
* @param {String} opts.description
892892
* @param {File} opts.file
893-
* @param {String} opts.size
893+
* @param {Number} opts.size
894894
* @param {Date} opts.createdAt
895895
* @param {Date} opts.updatedAt
896896
* @param {String} opts.ifcId

src/model/Document.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
obj['file'] = ApiClient.convertToType(data['file'], 'String');
104104
}
105105
if (data.hasOwnProperty('size')) {
106-
obj['size'] = ApiClient.convertToType(data['size'], 'String');
106+
obj['size'] = ApiClient.convertToType(data['size'], 'Number');
107107
}
108108
if (data.hasOwnProperty('created_at')) {
109109
obj['created_at'] = ApiClient.convertToType(data['created_at'], 'Date');
@@ -155,7 +155,7 @@
155155
*/
156156
exports.prototype['file'] = undefined;
157157
/**
158-
* @member {String} size
158+
* @member {Number} size
159159
*/
160160
exports.prototype['size'] = undefined;
161161
/**

test/api/CloudApi.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@
7171
done();
7272
});
7373
});
74+
describe('createDemo', function() {
75+
it('should call createDemo successfully', function(done) {
76+
//uncomment below and update the code to test createDemo
77+
//instance.createDemo(function(error) {
78+
// if (error) throw error;
79+
//expect().to.be();
80+
//});
81+
done();
82+
});
83+
});
7484
describe('deleteCloudUser', function() {
7585
it('should call deleteCloudUser successfully', function(done) {
7686
//uncomment below and update the code to test deleteCloudUser

0 commit comments

Comments
 (0)