Skip to content

Commit 175e060

Browse files
committed
PATCH: add parent_id field in model
1 parent 964ffc6 commit 175e060

File tree

8 files changed

+45
-9
lines changed

8 files changed

+45
-9
lines changed

docs/CollaborationApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ Name | Type | Description | Notes
955955
956956
Create a document
957957

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

960960
### Example
961961

docs/Model.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Name | Type | Description | Notes
3232
**version** | **String** | This field is only for information. Updating it won't impact the export. | [optional]
3333
**northVector** | **[[Number]]** | This field is only for information. Updating it won't impact the export. | [optional]
3434
**recommanded2dAngle** | **Number** | This is the angle in clockwise degree to apply on the 2D to optimise the horizontality of objects. This field is only for information. Updating it won't impact the export. | [optional]
35+
**parentId** | **Number** | The first page of the pdf | [readonly]
3536
**pageNumber** | **Number** | The page number of the related pdf | [readonly]
3637
**children** | [**[ModelSerializerWithoutChildren]**](ModelSerializerWithoutChildren.md) | Contains additional pages of a pdf | [readonly]
3738

docs/ModelSerializerWithoutChildren.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Name | Type | Description | Notes
3232
**version** | **String** | This field is only for information. Updating it won't impact the export. | [optional]
3333
**northVector** | **[[Number]]** | This field is only for information. Updating it won't impact the export. | [optional]
3434
**recommanded2dAngle** | **Number** | This is the angle in clockwise degree to apply on the 2D to optimise the horizontality of objects. This field is only for information. Updating it won't impact the export. | [optional]
35+
**parentId** | **Number** | The first page of the pdf | [readonly]
3536
**pageNumber** | **Number** | The page number of the related pdf | [readonly]
3637

3738

src/api/CollaborationApi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export default class CollaborationApi {
858858

859859
/**
860860
* Create a document
861-
* Create a document. If the document is one of {'GLTF', 'DWG', 'POINT_CLOUD', 'OBJ', 'IFC', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
861+
* Create a document. If the document is one of {'GLTF', 'OBJ', 'IFC', 'DWG', 'POINT_CLOUD', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
862862
* @param {Number} cloudPk A unique integer value identifying this cloud.
863863
* @param {Number} projectPk A unique integer value identifying this project.
864864
* @param {String} name Shown name of the file
@@ -924,7 +924,7 @@ export default class CollaborationApi {
924924

925925
/**
926926
* Create a document
927-
* Create a document. If the document is one of {'GLTF', 'DWG', 'POINT_CLOUD', 'OBJ', 'IFC', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
927+
* Create a document. If the document is one of {'GLTF', 'OBJ', 'IFC', 'DWG', 'POINT_CLOUD', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
928928
* @param {Number} cloudPk A unique integer value identifying this cloud.
929929
* @param {Number} projectPk A unique integer value identifying this project.
930930
* @param {String} name Shown name of the file

src/model/Model.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,21 @@ class Model {
4646
* @param projectId {Number}
4747
* @param errors {Array.<String>} List of errors that happened during IFC processing
4848
* @param warnings {Array.<String>} List of warnings that happened during IFC processing
49+
* @param parentId {Number} The first page of the pdf
4950
* @param pageNumber {Number} The page number of the related pdf
5051
* @param children {Array.<module:model/ModelSerializerWithoutChildren>} Contains additional pages of a pdf
5152
*/
52-
constructor(id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, pageNumber, children) {
53+
constructor(id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, parentId, pageNumber, children) {
5354

54-
Model.initialize(this, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, pageNumber, children);
55+
Model.initialize(this, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, parentId, pageNumber, children);
5556
}
5657

5758
/**
5859
* Initializes the fields of this object.
5960
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
6061
* Only for internal use.
6162
*/
62-
static initialize(obj, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, pageNumber, children) {
63+
static initialize(obj, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, parentId, pageNumber, children) {
6364
obj['id'] = id;
6465
obj['type'] = type;
6566
obj['creator'] = creator;
@@ -80,6 +81,7 @@ class Model {
8081
obj['project_id'] = projectId;
8182
obj['errors'] = errors;
8283
obj['warnings'] = warnings;
84+
obj['parent_id'] = parentId;
8385
obj['page_number'] = pageNumber;
8486
obj['children'] = children;
8587
}
@@ -179,6 +181,9 @@ class Model {
179181
if (data.hasOwnProperty('recommanded_2d_angle')) {
180182
obj['recommanded_2d_angle'] = ApiClient.convertToType(data['recommanded_2d_angle'], 'Number');
181183
}
184+
if (data.hasOwnProperty('parent_id')) {
185+
obj['parent_id'] = ApiClient.convertToType(data['parent_id'], 'Number');
186+
}
182187
if (data.hasOwnProperty('page_number')) {
183188
obj['page_number'] = ApiClient.convertToType(data['page_number'], 'Number');
184189
}
@@ -343,6 +348,12 @@ Model.prototype['north_vector'] = undefined;
343348
*/
344349
Model.prototype['recommanded_2d_angle'] = undefined;
345350

351+
/**
352+
* The first page of the pdf
353+
* @member {Number} parent_id
354+
*/
355+
Model.prototype['parent_id'] = undefined;
356+
346357
/**
347358
* The page number of the related pdf
348359
* @member {Number} page_number

src/model/ModelSerializerWithoutChildren.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,20 @@ class ModelSerializerWithoutChildren {
4545
* @param projectId {Number}
4646
* @param errors {Array.<String>} List of errors that happened during IFC processing
4747
* @param warnings {Array.<String>} List of warnings that happened during IFC processing
48+
* @param parentId {Number} The first page of the pdf
4849
* @param pageNumber {Number} The page number of the related pdf
4950
*/
50-
constructor(id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, pageNumber) {
51+
constructor(id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, parentId, pageNumber) {
5152

52-
ModelSerializerWithoutChildren.initialize(this, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, pageNumber);
53+
ModelSerializerWithoutChildren.initialize(this, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, parentId, pageNumber);
5354
}
5455

5556
/**
5657
* Initializes the fields of this object.
5758
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
5859
* Only for internal use.
5960
*/
60-
static initialize(obj, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, pageNumber) {
61+
static initialize(obj, id, type, creator, status, createdAt, updatedAt, documentId, document, structureFile, systemsFile, mapFile, gltfFile, previewFile, viewer360File, xktFile, xktFiles, binary2dFile, projectId, errors, warnings, parentId, pageNumber) {
6162
obj['id'] = id;
6263
obj['type'] = type;
6364
obj['creator'] = creator;
@@ -78,6 +79,7 @@ class ModelSerializerWithoutChildren {
7879
obj['project_id'] = projectId;
7980
obj['errors'] = errors;
8081
obj['warnings'] = warnings;
82+
obj['parent_id'] = parentId;
8183
obj['page_number'] = pageNumber;
8284
}
8385

@@ -176,6 +178,9 @@ class ModelSerializerWithoutChildren {
176178
if (data.hasOwnProperty('recommanded_2d_angle')) {
177179
obj['recommanded_2d_angle'] = ApiClient.convertToType(data['recommanded_2d_angle'], 'Number');
178180
}
181+
if (data.hasOwnProperty('parent_id')) {
182+
obj['parent_id'] = ApiClient.convertToType(data['parent_id'], 'Number');
183+
}
179184
if (data.hasOwnProperty('page_number')) {
180185
obj['page_number'] = ApiClient.convertToType(data['page_number'], 'Number');
181186
}
@@ -337,6 +342,12 @@ ModelSerializerWithoutChildren.prototype['north_vector'] = undefined;
337342
*/
338343
ModelSerializerWithoutChildren.prototype['recommanded_2d_angle'] = undefined;
339344

345+
/**
346+
* The first page of the pdf
347+
* @member {Number} parent_id
348+
*/
349+
ModelSerializerWithoutChildren.prototype['parent_id'] = undefined;
350+
340351
/**
341352
* The page number of the related pdf
342353
* @member {Number} page_number

test/model/Model.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@
222222
//expect(instance).to.be();
223223
});
224224

225+
it('should have the property parentId (base name: "parent_id")', function() {
226+
// uncomment below and update the code to test the property parentId
227+
//var instance = new bimdata.Model();
228+
//expect(instance).to.be();
229+
});
230+
225231
it('should have the property pageNumber (base name: "page_number")', function() {
226232
// uncomment below and update the code to test the property pageNumber
227233
//var instance = new bimdata.Model();

test/model/ModelSerializerWithoutChildren.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@
222222
//expect(instance).to.be();
223223
});
224224

225+
it('should have the property parentId (base name: "parent_id")', function() {
226+
// uncomment below and update the code to test the property parentId
227+
//var instance = new bimdata.ModelSerializerWithoutChildren();
228+
//expect(instance).to.be();
229+
});
230+
225231
it('should have the property pageNumber (base name: "page_number")', function() {
226232
// uncomment below and update the code to test the property pageNumber
227233
//var instance = new bimdata.ModelSerializerWithoutChildren();

0 commit comments

Comments
 (0)