Skip to content

Commit

Permalink
PATCH: fix(storey): allow to add photosphere as storey plan + fix pro…
Browse files Browse the repository at this point in the history
…cess_hint on createDocument (#790)

* fix(storey): allow to add photosphere as storey plan

* fix(storey): create STOREY_CHILD_TYPES list + add 'process_hint' to Docuemnt serializer fields
  • Loading branch information
Bimdata-io committed Nov 19, 2024
1 parent 7237a4e commit 9350b26
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
20 changes: 16 additions & 4 deletions package/src/apis/CollaborationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ export interface CreateDocumentRequest {
model_source?: CreateDocumentModelSourceEnum;
ifc_source?: CreateDocumentIfcSourceEnum;
successor_of?: number;
process_hint?: CreateDocumentProcessHintEnum;
}

export interface CreateFolderRequest {
Expand Down Expand Up @@ -1670,7 +1671,7 @@ export class CollaborationApi extends runtime.BaseAPI {
}

/**
* Create a document. If the document is one of {\'GLTF\', \'OBJ\', \'IFC\', \'DWG\', \'DXF\', \'POINT_CLOUD\'}, a model will be created and attached to this document Required scopes: document:write
* 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
* Create a document
*/
async createDocumentRaw(requestParameters: CreateDocumentRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Document>> {
Expand Down Expand Up @@ -1761,6 +1762,10 @@ export class CollaborationApi extends runtime.BaseAPI {
formParams.append('successor_of', requestParameters.successor_of as any);
}

if (requestParameters.process_hint !== undefined) {
formParams.append('process_hint', requestParameters.process_hint as any);
}

const response = await this.request({
path: `/cloud/{cloud_pk}/project/{project_pk}/document`.replace(`{${"cloud_pk"}}`, encodeURIComponent(String(requestParameters.cloud_pk))).replace(`{${"project_pk"}}`, encodeURIComponent(String(requestParameters.project_pk))),
method: 'POST',
Expand All @@ -1773,11 +1778,11 @@ export class CollaborationApi extends runtime.BaseAPI {
}

/**
* Create a document. If the document is one of {\'GLTF\', \'OBJ\', \'IFC\', \'DWG\', \'DXF\', \'POINT_CLOUD\'}, a model will be created and attached to this document Required scopes: document:write
* 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
* 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> {
const response = await this.createDocumentRaw({ cloud_pk: cloud_pk, project_pk: project_pk, name: name, file: file, parent_id: parent_id, file_name: file_name, description: description, model_source: model_source, ifc_source: ifc_source, successor_of: successor_of }, initOverrides);
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, process_hint?: CreateDocumentProcessHintEnum, initOverrides?: RequestInit): Promise<Document> {
const response = await this.createDocumentRaw({ cloud_pk: cloud_pk, project_pk: project_pk, name: name, file: file, parent_id: parent_id, file_name: file_name, description: description, model_source: model_source, ifc_source: ifc_source, successor_of: successor_of, process_hint: process_hint }, initOverrides);
return await response.value();
}

Expand Down Expand Up @@ -7556,6 +7561,13 @@ export enum CreateDocumentIfcSourceEnum {
Export = 'EXPORT',
Optimized = 'OPTIMIZED'
}
/**
* @export
* @enum {string}
*/
export enum CreateDocumentProcessHintEnum {
Photosphere = 'PHOTOSPHERE'
}
/**
* @export
* @enum {string}
Expand Down
8 changes: 4 additions & 4 deletions package/src/apis/ModelApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2460,7 +2460,7 @@ export class ModelApi extends runtime.BaseAPI {
}

/**
* Create a relation between a 2d model and a building. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a building. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\', \'PHOTOSPHERE\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a building
*/
async createBuildingPlanRaw(requestParameters: CreateBuildingPlanRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Building>> {
Expand Down Expand Up @@ -2520,7 +2520,7 @@ export class ModelApi extends runtime.BaseAPI {
}

/**
* Create a relation between a 2d model and a building. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a building. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\', \'PHOTOSPHERE\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a building
*/
async createBuildingPlan(building_uuid: string, cloud_pk: number, model_pk: number, project_pk: number, BuildingModelPlanRequest: BuildingModelPlanRequest, initOverrides?: RequestInit): Promise<Building> {
Expand Down Expand Up @@ -3923,7 +3923,7 @@ export class ModelApi extends runtime.BaseAPI {
}

/**
* Create a relation between a 2d model and a storey. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a storey. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\', \'PHOTOSPHERE\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a storey
*/
async createStoreyPlanRaw(requestParameters: CreateStoreyPlanRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Storey>> {
Expand Down Expand Up @@ -3983,7 +3983,7 @@ export class ModelApi extends runtime.BaseAPI {
}

/**
* Create a relation between a 2d model and a storey. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a storey. The model type must be one of : (\'DWG\', \'DXF\', \'PDF\', \'JPEG\', \'PNG\', \'PHOTOSPHERE\') Required scopes: ifc:write, model:write
* Create a relation between a 2d model and a storey
*/
async createStoreyPlan(cloud_pk: number, model_pk: number, project_pk: number, storey_uuid: string, StoreyModelPlanRequest: StoreyModelPlanRequest, initOverrides?: RequestInit): Promise<Storey> {
Expand Down
16 changes: 16 additions & 0 deletions package/src/models/PatchedDocumentRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ export interface PatchedDocumentRequest {
* @memberof PatchedDocumentRequest
*/
successor_of?: number;
/**
* Provide a info about the document in order to customize the way it is processed.
*
* * `PHOTOSPHERE` - PHOTOSPHERE
* @type {string}
* @memberof PatchedDocumentRequest
*/
process_hint?: PatchedDocumentRequestProcessHintEnum;
}

/**
Expand All @@ -101,6 +109,12 @@ export enum PatchedDocumentRequestIfcSourceEnum {
Merge = 'MERGE',
Export = 'EXPORT',
Optimized = 'OPTIMIZED'
}/**
* @export
* @enum {string}
*/
export enum PatchedDocumentRequestProcessHintEnum {
Photosphere = 'PHOTOSPHERE'
}

export function PatchedDocumentRequestFromJSON(json: any): PatchedDocumentRequest {
Expand All @@ -121,6 +135,7 @@ export function PatchedDocumentRequestFromJSONTyped(json: any, ignoreDiscriminat
'model_source': !exists(json, 'model_source') ? undefined : json['model_source'],
'ifc_source': !exists(json, 'ifc_source') ? undefined : json['ifc_source'],
'successor_of': !exists(json, 'successor_of') ? undefined : json['successor_of'],
'process_hint': !exists(json, 'process_hint') ? undefined : json['process_hint'],
};
}

Expand All @@ -141,6 +156,7 @@ export function PatchedDocumentRequestToJSON(value?: PatchedDocumentRequest | nu
'model_source': value.model_source,
'ifc_source': value.ifc_source,
'successor_of': value.successor_of,
'process_hint': value.process_hint,
};
}

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

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

'name': value.name,
'default_permission': value.default_permission,
'parent_id': value.parent_id,
'name': value.name,
'children': value.children === undefined ? undefined : (value.children === null ? null : (value.children as Array<any>).map(WriteFolderRequestToJSON)),
};
}
Expand Down

0 comments on commit 9350b26

Please sign in to comment.