Skip to content

Commit 4fab303

Browse files
committed
MINOR: add routes to manage zone_space relations (#690)
1 parent 5d24a50 commit 4fab303

File tree

6 files changed

+236
-10
lines changed

6 files changed

+236
-10
lines changed

package/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ src/models/XktFile.ts
242242
src/models/Zone.ts
243243
src/models/ZoneRequest.ts
244244
src/models/ZoneSpace.ts
245+
src/models/ZoneSpaceRelationRequest.ts
245246
src/models/ZoneSpaceRequest.ts
246247
src/models/index.ts
247248
src/runtime.ts

package/src/apis/CollaborationApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ export class CollaborationApi extends runtime.BaseAPI {
15641564
}
15651565

15661566
/**
1567-
* Create a document. If the document is one of {\'OBJ\', \'DWG\', \'POINT_CLOUD\', \'DXF\', \'IFC\', \'GLTF\'}, a model will be created and attached to this document Required scopes: document:write
1567+
* Create a document. If the document is one of {\'OBJ\', \'IFC\', \'GLTF\', \'DXF\', \'POINT_CLOUD\', \'DWG\'}, a model will be created and attached to this document Required scopes: document:write
15681568
* Create a document
15691569
*/
15701570
async createDocumentRaw(requestParameters: CreateDocumentRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Document>> {
@@ -1667,7 +1667,7 @@ export class CollaborationApi extends runtime.BaseAPI {
16671667
}
16681668

16691669
/**
1670-
* Create a document. If the document is one of {\'OBJ\', \'DWG\', \'POINT_CLOUD\', \'DXF\', \'IFC\', \'GLTF\'}, a model will be created and attached to this document Required scopes: document:write
1670+
* Create a document. If the document is one of {\'OBJ\', \'IFC\', \'GLTF\', \'DXF\', \'POINT_CLOUD\', \'DWG\'}, a model will be created and attached to this document Required scopes: document:write
16711671
* Create a document
16721672
*/
16731673
async createDocument(cloud_pk: number, project_pk: number, name: string, file: Blob, parent_id?: number | null, file_name?: string, description?: string | null, model_source?: CreateDocumentModelSourceEnum, ifc_source?: CreateDocumentIfcSourceEnum, successor_of?: number, initOverrides?: RequestInit): Promise<Document> {

package/src/apis/IfcApi.ts

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ import {
210210
ZoneSpace,
211211
ZoneSpaceFromJSON,
212212
ZoneSpaceToJSON,
213+
ZoneSpaceRelationRequest,
214+
ZoneSpaceRelationRequestFromJSON,
215+
ZoneSpaceRelationRequestToJSON,
213216
ZoneSpaceRequest,
214217
ZoneSpaceRequestFromJSON,
215218
ZoneSpaceRequestToJSON,
@@ -222,6 +225,14 @@ export interface AddIfcErrorsDeprecatedRequest {
222225
ModelErrorsRequest?: ModelErrorsRequest;
223226
}
224227

228+
export interface AddZoneSpaceDeprecatedRequest {
229+
cloud_pk: number;
230+
ifc_pk: number;
231+
project_pk: number;
232+
zone_pk: number;
233+
ZoneSpaceRelationRequest: ZoneSpaceRelationRequest;
234+
}
235+
225236
export interface BulkDeleteIfcClassificationsDeprecatedRequest {
226237
cloud_pk: number;
227238
ifc_pk: number;
@@ -1387,6 +1398,75 @@ export class IfcApi extends runtime.BaseAPI {
13871398
return await response.value();
13881399
}
13891400

1401+
/**
1402+
* Add a space to a zone. The IFC file will not be updated. The created space will be accessible over the API and when exporting an IFC file Required scopes: ifc:write, model:write
1403+
* Add a space to a zone
1404+
*/
1405+
async addZoneSpaceDeprecatedRaw(requestParameters: AddZoneSpaceDeprecatedRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ZoneSpace>> {
1406+
if (requestParameters.cloud_pk === null || requestParameters.cloud_pk === undefined) {
1407+
throw new runtime.RequiredError('cloud_pk','Required parameter requestParameters.cloud_pk was null or undefined when calling addZoneSpaceDeprecated.');
1408+
}
1409+
1410+
if (requestParameters.ifc_pk === null || requestParameters.ifc_pk === undefined) {
1411+
throw new runtime.RequiredError('ifc_pk','Required parameter requestParameters.ifc_pk was null or undefined when calling addZoneSpaceDeprecated.');
1412+
}
1413+
1414+
if (requestParameters.project_pk === null || requestParameters.project_pk === undefined) {
1415+
throw new runtime.RequiredError('project_pk','Required parameter requestParameters.project_pk was null or undefined when calling addZoneSpaceDeprecated.');
1416+
}
1417+
1418+
if (requestParameters.zone_pk === null || requestParameters.zone_pk === undefined) {
1419+
throw new runtime.RequiredError('zone_pk','Required parameter requestParameters.zone_pk was null or undefined when calling addZoneSpaceDeprecated.');
1420+
}
1421+
1422+
if (requestParameters.ZoneSpaceRelationRequest === null || requestParameters.ZoneSpaceRelationRequest === undefined) {
1423+
throw new runtime.RequiredError('ZoneSpaceRelationRequest','Required parameter requestParameters.ZoneSpaceRelationRequest was null or undefined when calling addZoneSpaceDeprecated.');
1424+
}
1425+
1426+
const queryParameters: any = {};
1427+
1428+
const headerParameters: runtime.HTTPHeaders = {};
1429+
1430+
headerParameters['Content-Type'] = 'application/json';
1431+
1432+
if (this.configuration && this.configuration.apiKey) {
1433+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
1434+
}
1435+
1436+
if (this.configuration && this.configuration.accessToken) {
1437+
// oauth required
1438+
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
1439+
}
1440+
1441+
if (this.configuration && this.configuration.accessToken) {
1442+
// oauth required
1443+
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
1444+
}
1445+
1446+
if (this.configuration && this.configuration.apiKey) {
1447+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Bearer authentication
1448+
}
1449+
1450+
const response = await this.request({
1451+
path: `/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone/{zone_pk}/space/add`.replace(`{${"cloud_pk"}}`, encodeURIComponent(String(requestParameters.cloud_pk))).replace(`{${"ifc_pk"}}`, encodeURIComponent(String(requestParameters.ifc_pk))).replace(`{${"project_pk"}}`, encodeURIComponent(String(requestParameters.project_pk))).replace(`{${"zone_pk"}}`, encodeURIComponent(String(requestParameters.zone_pk))),
1452+
method: 'POST',
1453+
headers: headerParameters,
1454+
query: queryParameters,
1455+
body: ZoneSpaceRelationRequestToJSON(requestParameters.ZoneSpaceRelationRequest),
1456+
}, initOverrides);
1457+
1458+
return new runtime.JSONApiResponse(response, (jsonValue) => ZoneSpaceFromJSON(jsonValue));
1459+
}
1460+
1461+
/**
1462+
* Add a space to a zone. The IFC file will not be updated. The created space will be accessible over the API and when exporting an IFC file Required scopes: ifc:write, model:write
1463+
* Add a space to a zone
1464+
*/
1465+
async addZoneSpaceDeprecated(cloud_pk: number, ifc_pk: number, project_pk: number, zone_pk: number, ZoneSpaceRelationRequest: ZoneSpaceRelationRequest, initOverrides?: RequestInit): Promise<ZoneSpace> {
1466+
const response = await this.addZoneSpaceDeprecatedRaw({ cloud_pk: cloud_pk, ifc_pk: ifc_pk, project_pk: project_pk, zone_pk: zone_pk, ZoneSpaceRelationRequest: ZoneSpaceRelationRequest }, initOverrides);
1467+
return await response.value();
1468+
}
1469+
13901470
/**
13911471
* Delete relation between filtered classifications (eg. /classifications?name=untec) and all mode\'s elements. No classification will be deleted on this endpoint, only the relation between model\'s elements and their classification. Required scopes: ifc:write, model:write
13921472
* Remove all classifications from model\'s elements
@@ -4991,8 +5071,8 @@ export class IfcApi extends runtime.BaseAPI {
49915071
}
49925072

49935073
/**
4994-
* The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
4995-
* Delete a space of a zone
5074+
* Delete the relation between a space and a zone. The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
5075+
* Delete the relation between a space and a zone
49965076
*/
49975077
async deleteZoneSpaceDeprecatedRaw(requestParameters: DeleteZoneSpaceDeprecatedRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<void>> {
49985078
if (requestParameters.cloud_pk === null || requestParameters.cloud_pk === undefined) {
@@ -5048,8 +5128,8 @@ export class IfcApi extends runtime.BaseAPI {
50485128
}
50495129

50505130
/**
5051-
* The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
5052-
* Delete a space of a zone
5131+
* Delete the relation between a space and a zone. The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
5132+
* Delete the relation between a space and a zone
50535133
*/
50545134
async deleteZoneSpaceDeprecated(cloud_pk: number, id: number, ifc_pk: number, project_pk: number, zone_pk: number, initOverrides?: RequestInit): Promise<void> {
50555135
await this.deleteZoneSpaceDeprecatedRaw({ cloud_pk: cloud_pk, id: id, ifc_pk: ifc_pk, project_pk: project_pk, zone_pk: zone_pk }, initOverrides);

package/src/apis/ModelApi.ts

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ import {
210210
ZoneSpace,
211211
ZoneSpaceFromJSON,
212212
ZoneSpaceToJSON,
213+
ZoneSpaceRelationRequest,
214+
ZoneSpaceRelationRequestFromJSON,
215+
ZoneSpaceRelationRequestToJSON,
213216
ZoneSpaceRequest,
214217
ZoneSpaceRequestFromJSON,
215218
ZoneSpaceRequestToJSON,
@@ -222,6 +225,14 @@ export interface AddModelErrorsRequest {
222225
ModelErrorsRequest?: ModelErrorsRequest;
223226
}
224227

228+
export interface AddZoneSpaceRequest {
229+
cloud_pk: number;
230+
model_pk: number;
231+
project_pk: number;
232+
zone_pk: number;
233+
ZoneSpaceRelationRequest: ZoneSpaceRelationRequest;
234+
}
235+
225236
export interface BulkDeleteModelClassificationsRequest {
226237
cloud_pk: number;
227238
model_pk: number;
@@ -1393,6 +1404,75 @@ export class ModelApi extends runtime.BaseAPI {
13931404
return await response.value();
13941405
}
13951406

1407+
/**
1408+
* Add a space to a zone. The IFC file will not be updated. The created space will be accessible over the API and when exporting an IFC file Required scopes: ifc:write, model:write
1409+
* Add a space to a zone
1410+
*/
1411+
async addZoneSpaceRaw(requestParameters: AddZoneSpaceRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ZoneSpace>> {
1412+
if (requestParameters.cloud_pk === null || requestParameters.cloud_pk === undefined) {
1413+
throw new runtime.RequiredError('cloud_pk','Required parameter requestParameters.cloud_pk was null or undefined when calling addZoneSpace.');
1414+
}
1415+
1416+
if (requestParameters.model_pk === null || requestParameters.model_pk === undefined) {
1417+
throw new runtime.RequiredError('model_pk','Required parameter requestParameters.model_pk was null or undefined when calling addZoneSpace.');
1418+
}
1419+
1420+
if (requestParameters.project_pk === null || requestParameters.project_pk === undefined) {
1421+
throw new runtime.RequiredError('project_pk','Required parameter requestParameters.project_pk was null or undefined when calling addZoneSpace.');
1422+
}
1423+
1424+
if (requestParameters.zone_pk === null || requestParameters.zone_pk === undefined) {
1425+
throw new runtime.RequiredError('zone_pk','Required parameter requestParameters.zone_pk was null or undefined when calling addZoneSpace.');
1426+
}
1427+
1428+
if (requestParameters.ZoneSpaceRelationRequest === null || requestParameters.ZoneSpaceRelationRequest === undefined) {
1429+
throw new runtime.RequiredError('ZoneSpaceRelationRequest','Required parameter requestParameters.ZoneSpaceRelationRequest was null or undefined when calling addZoneSpace.');
1430+
}
1431+
1432+
const queryParameters: any = {};
1433+
1434+
const headerParameters: runtime.HTTPHeaders = {};
1435+
1436+
headerParameters['Content-Type'] = 'application/json';
1437+
1438+
if (this.configuration && this.configuration.apiKey) {
1439+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
1440+
}
1441+
1442+
if (this.configuration && this.configuration.accessToken) {
1443+
// oauth required
1444+
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
1445+
}
1446+
1447+
if (this.configuration && this.configuration.accessToken) {
1448+
// oauth required
1449+
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
1450+
}
1451+
1452+
if (this.configuration && this.configuration.apiKey) {
1453+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Bearer authentication
1454+
}
1455+
1456+
const response = await this.request({
1457+
path: `/cloud/{cloud_pk}/project/{project_pk}/model/{model_pk}/zone/{zone_pk}/space/add`.replace(`{${"cloud_pk"}}`, encodeURIComponent(String(requestParameters.cloud_pk))).replace(`{${"model_pk"}}`, encodeURIComponent(String(requestParameters.model_pk))).replace(`{${"project_pk"}}`, encodeURIComponent(String(requestParameters.project_pk))).replace(`{${"zone_pk"}}`, encodeURIComponent(String(requestParameters.zone_pk))),
1458+
method: 'POST',
1459+
headers: headerParameters,
1460+
query: queryParameters,
1461+
body: ZoneSpaceRelationRequestToJSON(requestParameters.ZoneSpaceRelationRequest),
1462+
}, initOverrides);
1463+
1464+
return new runtime.JSONApiResponse(response, (jsonValue) => ZoneSpaceFromJSON(jsonValue));
1465+
}
1466+
1467+
/**
1468+
* Add a space to a zone. The IFC file will not be updated. The created space will be accessible over the API and when exporting an IFC file Required scopes: ifc:write, model:write
1469+
* Add a space to a zone
1470+
*/
1471+
async addZoneSpace(cloud_pk: number, model_pk: number, project_pk: number, zone_pk: number, ZoneSpaceRelationRequest: ZoneSpaceRelationRequest, initOverrides?: RequestInit): Promise<ZoneSpace> {
1472+
const response = await this.addZoneSpaceRaw({ cloud_pk: cloud_pk, model_pk: model_pk, project_pk: project_pk, zone_pk: zone_pk, ZoneSpaceRelationRequest: ZoneSpaceRelationRequest }, initOverrides);
1473+
return await response.value();
1474+
}
1475+
13961476
/**
13971477
* Delete relation between filtered classifications (eg. /classifications?name=untec) and all mode\'s elements. No classification will be deleted on this endpoint, only the relation between model\'s elements and their classification. Required scopes: ifc:write, model:write
13981478
* Remove all classifications from model\'s elements
@@ -4997,8 +5077,8 @@ export class ModelApi extends runtime.BaseAPI {
49975077
}
49985078

49995079
/**
5000-
* The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
5001-
* Delete a space of a zone
5080+
* Delete the relation between a space and a zone. The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
5081+
* Delete the relation between a space and a zone
50025082
*/
50035083
async deleteZoneSpaceRaw(requestParameters: DeleteZoneSpaceRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<void>> {
50045084
if (requestParameters.cloud_pk === null || requestParameters.cloud_pk === undefined) {
@@ -5054,8 +5134,8 @@ export class ModelApi extends runtime.BaseAPI {
50545134
}
50555135

50565136
/**
5057-
* The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
5058-
* Delete a space of a zone
5137+
* Delete the relation between a space and a zone. The IFC file will not be updated. The remaining spaces are available in API and will be available when exporting an IFC file Required scopes: ifc:write, model:write
5138+
* Delete the relation between a space and a zone
50595139
*/
50605140
async deleteZoneSpace(cloud_pk: number, id: number, model_pk: number, project_pk: number, zone_pk: number, initOverrides?: RequestInit): Promise<void> {
50615141
await this.deleteZoneSpaceRaw({ cloud_pk: cloud_pk, id: id, model_pk: model_pk, project_pk: project_pk, zone_pk: zone_pk }, initOverrides);
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* BIMData API
5+
* 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.
6+
*
7+
* The version of the OpenAPI document: v1 (v1)
8+
* Contact: [email protected]
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
import { exists, mapValues } from '../runtime';
16+
/**
17+
*
18+
* @export
19+
* @interface ZoneSpaceRelationRequest
20+
*/
21+
export interface ZoneSpaceRelationRequest {
22+
/**
23+
*
24+
* @type {number}
25+
* @memberof ZoneSpaceRelationRequest
26+
*/
27+
id: number;
28+
/**
29+
*
30+
* @type {number}
31+
* @memberof ZoneSpaceRelationRequest
32+
*/
33+
order?: number;
34+
}
35+
36+
export function ZoneSpaceRelationRequestFromJSON(json: any): ZoneSpaceRelationRequest {
37+
return ZoneSpaceRelationRequestFromJSONTyped(json, false);
38+
}
39+
40+
export function ZoneSpaceRelationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZoneSpaceRelationRequest {
41+
if ((json === undefined) || (json === null)) {
42+
return json;
43+
}
44+
return {
45+
46+
'id': json['id'],
47+
'order': !exists(json, 'order') ? undefined : json['order'],
48+
};
49+
}
50+
51+
export function ZoneSpaceRelationRequestToJSON(value?: ZoneSpaceRelationRequest | null): any {
52+
if (value === undefined) {
53+
return undefined;
54+
}
55+
if (value === null) {
56+
return null;
57+
}
58+
return {
59+
60+
'id': value.id,
61+
'order': value.order,
62+
};
63+
}
64+

package/src/models/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,5 @@ export * from './XktFile';
235235
export * from './Zone';
236236
export * from './ZoneRequest';
237237
export * from './ZoneSpace';
238+
export * from './ZoneSpaceRelationRequest';
238239
export * from './ZoneSpaceRequest';

0 commit comments

Comments
 (0)