Skip to content

Commit

Permalink
MINOR: Feat/add link between zone and storey (#723)
Browse files Browse the repository at this point in the history
* Add a link between zone and storey.

* Zone-storey, use uuid instead of pk.

* Rename storey as storey_uuid in zone serializer.

* Split update/remove storey from zone test.
  • Loading branch information
Bimdata-io committed Feb 22, 2024
1 parent fd63c82 commit 46a9134
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 10 deletions.
1 change: 1 addition & 0 deletions package/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ src/models/Viewpoint.ts
src/models/ViewpointRequest.ts
src/models/Visa.ts
src/models/VisaAttachment.ts
src/models/VisaAttachmentRequest.ts
src/models/VisaComment.ts
src/models/VisaCommentRequest.ts
src/models/VisaRequest.ts
Expand Down
6 changes: 4 additions & 2 deletions package/src/apis/CollaborationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ export class CollaborationApi extends runtime.BaseAPI {
const consumes: runtime.Consume[] = [
{ contentType: 'multipart/form-data' },
{ contentType: 'application/x-www-form-urlencoded' },
{ contentType: 'application/json' },
];
// @ts-ignore: canConsumeForm may be unused
const canConsumeForm = runtime.canConsumeForm(consumes);
Expand Down Expand Up @@ -1655,7 +1656,7 @@ export class CollaborationApi extends runtime.BaseAPI {
}

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

/**
* Create a document. If the document is one of {\'GLTF\', \'POINT_CLOUD\', \'DWG\', \'OBJ\', \'IFC\', \'DXF\'}, a model will be created and attached to this document Required scopes: document:write
* Create a document. If the document is one of {\'POINT_CLOUD\', \'OBJ\', \'IFC\', \'DXF\', \'GLTF\', \'DWG\'}, a model will be created and attached to this document Required scopes: document:write
* Create a document
*/
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> {
Expand Down Expand Up @@ -3285,6 +3286,7 @@ export class CollaborationApi extends runtime.BaseAPI {
const consumes: runtime.Consume[] = [
{ contentType: 'multipart/form-data' },
{ contentType: 'application/x-www-form-urlencoded' },
{ contentType: 'application/json' },
];
// @ts-ignore: canConsumeForm may be unused
const canConsumeForm = runtime.canConsumeForm(consumes);
Expand Down
8 changes: 8 additions & 0 deletions package/src/models/FolderWithoutChildrenRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export interface FolderWithoutChildrenRequest {
* @memberof FolderWithoutChildrenRequest
*/
default_permission?: FolderWithoutChildrenRequestDefaultPermissionEnum;
/**
*
* @type {boolean}
* @memberof FolderWithoutChildrenRequest
*/
propagate?: boolean;
}

/**
Expand All @@ -66,6 +72,7 @@ export function FolderWithoutChildrenRequestFromJSONTyped(json: any, ignoreDiscr
'parent_id': !exists(json, 'parent_id') ? undefined : json['parent_id'],
'name': json['name'],
'default_permission': !exists(json, 'default_permission') ? undefined : json['default_permission'],
'propagate': !exists(json, 'propagate') ? undefined : json['propagate'],
};
}

Expand All @@ -81,6 +88,7 @@ export function FolderWithoutChildrenRequestToJSON(value?: FolderWithoutChildren
'parent_id': value.parent_id,
'name': value.name,
'default_permission': value.default_permission,
'propagate': value.propagate,
};
}

8 changes: 8 additions & 0 deletions package/src/models/PatchedFolderWithoutChildrenRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export interface PatchedFolderWithoutChildrenRequest {
* @memberof PatchedFolderWithoutChildrenRequest
*/
default_permission?: PatchedFolderWithoutChildrenRequestDefaultPermissionEnum;
/**
*
* @type {boolean}
* @memberof PatchedFolderWithoutChildrenRequest
*/
propagate?: boolean;
}

/**
Expand All @@ -66,6 +72,7 @@ export function PatchedFolderWithoutChildrenRequestFromJSONTyped(json: any, igno
'parent_id': !exists(json, 'parent_id') ? undefined : json['parent_id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'default_permission': !exists(json, 'default_permission') ? undefined : json['default_permission'],
'propagate': !exists(json, 'propagate') ? undefined : json['propagate'],
};
}

Expand All @@ -81,6 +88,7 @@ export function PatchedFolderWithoutChildrenRequestToJSON(value?: PatchedFolderW
'parent_id': value.parent_id,
'name': value.name,
'default_permission': value.default_permission,
'propagate': value.propagate,
};
}

8 changes: 8 additions & 0 deletions package/src/models/PatchedZoneRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export interface PatchedZoneRequest {
* @memberof PatchedZoneRequest
*/
order?: number;
/**
* IFC element or element type UUID
* @type {string}
* @memberof PatchedZoneRequest
*/
storey_uuid?: string | null;
}

export function PatchedZoneRequestFromJSON(json: any): PatchedZoneRequest {
Expand All @@ -93,6 +99,7 @@ export function PatchedZoneRequestFromJSONTyped(json: any, ignoreDiscriminator:
'spaces': !exists(json, 'spaces') ? undefined : ((json['spaces'] as Array<any>).map(ZoneSpaceRequestFromJSON)),
'color': !exists(json, 'color') ? undefined : json['color'],
'order': !exists(json, 'order') ? undefined : json['order'],
'storey_uuid': !exists(json, 'storey_uuid') ? undefined : json['storey_uuid'],
};
}

Expand All @@ -112,6 +119,7 @@ export function PatchedZoneRequestToJSON(value?: PatchedZoneRequest | null): any
'spaces': value.spaces === undefined ? undefined : ((value.spaces as Array<any>).map(ZoneSpaceRequestToJSON)),
'color': value.color,
'order': value.order,
'storey_uuid': value.storey_uuid,
};
}

56 changes: 56 additions & 0 deletions package/src/models/VisaAttachmentRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* tslint:disable */
/* eslint-disable */
/**
* BIMData API
* 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.
*
* The version of the OpenAPI document: v1 (v1)
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface VisaAttachmentRequest
*/
export interface VisaAttachmentRequest {
/**
*
* @type {Blob}
* @memberof VisaAttachmentRequest
*/
attachment?: Blob | null;
}

export function VisaAttachmentRequestFromJSON(json: any): VisaAttachmentRequest {
return VisaAttachmentRequestFromJSONTyped(json, false);
}

export function VisaAttachmentRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): VisaAttachmentRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'attachment': !exists(json, 'attachment') ? undefined : json['attachment'],
};
}

export function VisaAttachmentRequestToJSON(value?: VisaAttachmentRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'attachment': value.attachment,
};
}

16 changes: 8 additions & 8 deletions package/src/models/WriteFolderRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ import { exists, mapValues } from '../runtime';
* @interface WriteFolderRequest
*/
export interface WriteFolderRequest {
/**
*
* @type {number}
* @memberof WriteFolderRequest
*/
parent_id?: number | null;
/**
* Name of the folder
* @type {string}
* @memberof WriteFolderRequest
*/
name: string;
/**
*
* @type {number}
* @memberof WriteFolderRequest
*/
parent_id?: number | null;
/**
* Permission for a Folder
*
Expand Down Expand Up @@ -69,8 +69,8 @@ export function WriteFolderRequestFromJSONTyped(json: any, ignoreDiscriminator:
}
return {

'parent_id': !exists(json, 'parent_id') ? undefined : json['parent_id'],
'name': json['name'],
'parent_id': !exists(json, 'parent_id') ? undefined : json['parent_id'],
'default_permission': !exists(json, 'default_permission') ? undefined : json['default_permission'],
'children': !exists(json, 'children') ? undefined : (json['children'] === null ? null : (json['children'] as Array<any>).map(WriteFolderRequestFromJSON)),
};
Expand All @@ -85,8 +85,8 @@ export function WriteFolderRequestToJSON(value?: WriteFolderRequest | null): any
}
return {

'parent_id': value.parent_id,
'name': value.name,
'parent_id': value.parent_id,
'default_permission': value.default_permission,
'children': value.children === undefined ? undefined : (value.children === null ? null : (value.children as Array<any>).map(WriteFolderRequestToJSON)),
};
Expand Down
8 changes: 8 additions & 0 deletions package/src/models/Zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ export interface Zone {
* @memberof Zone
*/
order?: number;
/**
* IFC element or element type UUID
* @type {string}
* @memberof Zone
*/
storey_uuid?: string | null;
}

export function ZoneFromJSON(json: any): Zone {
Expand All @@ -108,6 +114,7 @@ export function ZoneFromJSONTyped(json: any, ignoreDiscriminator: boolean): Zone
'updated_at': (new Date(json['updated_at'])),
'color': !exists(json, 'color') ? undefined : json['color'],
'order': !exists(json, 'order') ? undefined : json['order'],
'storey_uuid': !exists(json, 'storey_uuid') ? undefined : json['storey_uuid'],
};
}

Expand All @@ -127,6 +134,7 @@ export function ZoneToJSON(value?: Zone | null): any {
'spaces': value.spaces === undefined ? undefined : ((value.spaces as Array<any>).map(ZoneSpaceToJSON)),
'color': value.color,
'order': value.order,
'storey_uuid': value.storey_uuid,
};
}

8 changes: 8 additions & 0 deletions package/src/models/ZoneRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ export interface ZoneRequest {
* @memberof ZoneRequest
*/
order?: number;
/**
* IFC element or element type UUID
* @type {string}
* @memberof ZoneRequest
*/
storey_uuid?: string | null;
}

export function ZoneRequestFromJSON(json: any): ZoneRequest {
Expand All @@ -87,6 +93,7 @@ export function ZoneRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean
'spaces': !exists(json, 'spaces') ? undefined : ((json['spaces'] as Array<any>).map(ZoneSpaceRequestFromJSON)),
'color': !exists(json, 'color') ? undefined : json['color'],
'order': !exists(json, 'order') ? undefined : json['order'],
'storey_uuid': !exists(json, 'storey_uuid') ? undefined : json['storey_uuid'],
};
}

Expand All @@ -106,6 +113,7 @@ export function ZoneRequestToJSON(value?: ZoneRequest | null): any {
'spaces': value.spaces === undefined ? undefined : ((value.spaces as Array<any>).map(ZoneSpaceRequestToJSON)),
'color': value.color,
'order': value.order,
'storey_uuid': value.storey_uuid,
};
}

1 change: 1 addition & 0 deletions package/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export * from './Viewpoint';
export * from './ViewpointRequest';
export * from './Visa';
export * from './VisaAttachment';
export * from './VisaAttachmentRequest';
export * from './VisaComment';
export * from './VisaCommentRequest';
export * from './VisaRequest';
Expand Down

0 comments on commit 46a9134

Please sign in to comment.