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

Commit ccbfe5a

Browse files
committed
PATCH: add organization serializer in App and MPApp serializers (#452)
* add organization serializer in App and MPApp serializers * fix test and add select related * use Public Organization Serializer
1 parent 6111170 commit ccbfe5a

8 files changed

Lines changed: 179 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ Class | Method | HTTP request | Description
458458
- [bimdata.Property](docs/Property.md)
459459
- [bimdata.PropertyDefinition](docs/PropertyDefinition.md)
460460
- [bimdata.PropertySet](docs/PropertySet.md)
461+
- [bimdata.PublicOrganization](docs/PublicOrganization.md)
461462
- [bimdata.RawClassification](docs/RawClassification.md)
462463
- [bimdata.RawDefinition](docs/RawDefinition.md)
463464
- [bimdata.RawElement](docs/RawElement.md)

docs/MarketplaceApp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ Name | Type | Description | Notes
1919
**tags** | **[String]** | | [optional]
2020
**logo** | **String** | | [optional] [readonly]
2121
**images** | [**[MarketplaceAppImage]**](MarketplaceAppImage.md) | | [optional] [readonly]
22-
**organizationId** | **String** | | [optional] [readonly]
22+
**organization** | [**PublicOrganization**](PublicOrganization.md) | | [optional]
2323

2424

docs/PublicOrganization.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# bimdata.PublicOrganization
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**name** | **String** | Name of the organization |
8+
**logo** | **String** | | [optional] [readonly]
9+
10+

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ import ProjectWithChildren from './model/ProjectWithChildren';
7777
import Property from './model/Property';
7878
import PropertyDefinition from './model/PropertyDefinition';
7979
import PropertySet from './model/PropertySet';
80+
import PublicOrganization from './model/PublicOrganization';
8081
import RawClassification from './model/RawClassification';
8182
import RawDefinition from './model/RawDefinition';
8283
import RawElement from './model/RawElement';
@@ -548,6 +549,12 @@ export {
548549
*/
549550
PropertySet,
550551

552+
/**
553+
* The PublicOrganization model constructor.
554+
* @property {module:model/PublicOrganization}
555+
*/
556+
PublicOrganization,
557+
551558
/**
552559
* The RawClassification model constructor.
553560
* @property {module:model/RawClassification}

src/model/MarketplaceApp.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import ApiClient from '../ApiClient';
1515
import MarketplaceAppImage from './MarketplaceAppImage';
16+
import PublicOrganization from './PublicOrganization';
1617
import User from './User';
1718

1819
/**
@@ -100,8 +101,8 @@ class MarketplaceApp {
100101
if (data.hasOwnProperty('images')) {
101102
obj['images'] = ApiClient.convertToType(data['images'], [MarketplaceAppImage]);
102103
}
103-
if (data.hasOwnProperty('organization_id')) {
104-
obj['organization_id'] = ApiClient.convertToType(data['organization_id'], 'String');
104+
if (data.hasOwnProperty('organization')) {
105+
obj['organization'] = PublicOrganization.constructFromObject(data['organization']);
105106
}
106107
}
107108
return obj;
@@ -187,9 +188,9 @@ MarketplaceApp.prototype['logo'] = undefined;
187188
MarketplaceApp.prototype['images'] = undefined;
188189

189190
/**
190-
* @member {String} organization_id
191+
* @member {module:model/PublicOrganization} organization
191192
*/
192-
MarketplaceApp.prototype['organization_id'] = undefined;
193+
MarketplaceApp.prototype['organization'] = undefined;
193194

194195

195196

src/model/PublicOrganization.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
16+
/**
17+
* The PublicOrganization model module.
18+
* @module model/PublicOrganization
19+
* @version 0.0.0
20+
*/
21+
class PublicOrganization {
22+
/**
23+
* Constructs a new <code>PublicOrganization</code>.
24+
* @alias module:model/PublicOrganization
25+
* @param name {String} Name of the organization
26+
*/
27+
constructor(name) {
28+
29+
PublicOrganization.initialize(this, name);
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, name) {
38+
obj['name'] = name;
39+
}
40+
41+
/**
42+
* Constructs a <code>PublicOrganization</code> from a plain JavaScript object, optionally creating a new instance.
43+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
44+
* @param {Object} data The plain JavaScript object bearing properties of interest.
45+
* @param {module:model/PublicOrganization} obj Optional instance to populate.
46+
* @return {module:model/PublicOrganization} The populated <code>PublicOrganization</code> instance.
47+
*/
48+
static constructFromObject(data, obj) {
49+
if (data) {
50+
obj = obj || new PublicOrganization();
51+
52+
if (data.hasOwnProperty('name')) {
53+
obj['name'] = ApiClient.convertToType(data['name'], 'String');
54+
}
55+
if (data.hasOwnProperty('logo')) {
56+
obj['logo'] = ApiClient.convertToType(data['logo'], 'String');
57+
}
58+
}
59+
return obj;
60+
}
61+
62+
63+
}
64+
65+
/**
66+
* Name of the organization
67+
* @member {String} name
68+
*/
69+
PublicOrganization.prototype['name'] = undefined;
70+
71+
/**
72+
* @member {String} logo
73+
*/
74+
PublicOrganization.prototype['logo'] = undefined;
75+
76+
77+
78+
79+
80+
81+
export default PublicOrganization;
82+

test/model/MarketplaceApp.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@
144144
//expect(instance).to.be();
145145
});
146146

147-
it('should have the property organizationId (base name: "organization_id")', function() {
148-
// uncomment below and update the code to test the property organizationId
147+
it('should have the property organization (base name: "organization")', function() {
148+
// uncomment below and update the code to test the property organization
149149
//var instane = new bimdata.MarketplaceApp();
150150
//expect(instance).to.be();
151151
});
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.PublicOrganization();
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('PublicOrganization', function() {
51+
it('should create an instance of PublicOrganization', function() {
52+
// uncomment below and update the code to test PublicOrganization
53+
//var instane = new bimdata.PublicOrganization();
54+
//expect(instance).to.be.a(bimdata.PublicOrganization);
55+
});
56+
57+
it('should have the property name (base name: "name")', function() {
58+
// uncomment below and update the code to test the property name
59+
//var instane = new bimdata.PublicOrganization();
60+
//expect(instance).to.be();
61+
});
62+
63+
it('should have the property logo (base name: "logo")', function() {
64+
// uncomment below and update the code to test the property logo
65+
//var instane = new bimdata.PublicOrganization();
66+
//expect(instance).to.be();
67+
});
68+
69+
});
70+
71+
}));

0 commit comments

Comments
 (0)