Skip to content

Commit

Permalink
MINOR: Bcf odata (#772)
Browse files Browse the repository at this point in the history
* implement odata filters

* add orderby

* factorize

* replace test domains with bimdata.test
  • Loading branch information
Bimdata-io committed Sep 16, 2024
1 parent ee6851b commit e6cb0f2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
42 changes: 36 additions & 6 deletions package/src/apis/BcfApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ export interface GetCommentRequest {
export interface GetCommentsRequest {
projects_pk: number;
topics_guid: string;
$filter?: string;
$orderby?: string;
}

export interface GetDetailedExtensionsRequest {
Expand All @@ -329,6 +331,8 @@ export interface GetFullTopicRequest {

export interface GetFullTopicsRequest {
projects_pk: number;
$filter?: string;
$orderby?: string;
format?: string;
ifcs?: Array<number>;
img_format?: GetFullTopicsImgFormatEnum;
Expand Down Expand Up @@ -382,6 +386,8 @@ export interface GetTopicViewpointsRequest {

export interface GetTopicsRequest {
projects_pk: number;
$filter?: string;
$orderby?: string;
format?: string;
ifcs?: Array<number>;
models?: Array<number>;
Expand Down Expand Up @@ -2283,6 +2289,14 @@ export class BcfApi extends runtime.BaseAPI {

const queryParameters: any = {};

if (requestParameters.$filter !== undefined) {
queryParameters['$filter'] = requestParameters.$filter;
}

if (requestParameters.$orderby !== undefined) {
queryParameters['$orderby'] = requestParameters.$orderby;
}

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.apiKey) {
Expand Down Expand Up @@ -2317,8 +2331,8 @@ export class BcfApi extends runtime.BaseAPI {
* Retrieve all comments Required scopes: bcf:read
* Retrieve all comments
*/
async getComments(projects_pk: number, topics_guid: string, initOverrides?: RequestInit): Promise<Array<Comment>> {
const response = await this.getCommentsRaw({ projects_pk: projects_pk, topics_guid: topics_guid }, initOverrides);
async getComments(projects_pk: number, topics_guid: string, $filter?: string, $orderby?: string, initOverrides?: RequestInit): Promise<Array<Comment>> {
const response = await this.getCommentsRaw({ projects_pk: projects_pk, topics_guid: topics_guid, $filter: $filter, $orderby: $orderby }, initOverrides);
return await response.value();
}

Expand Down Expand Up @@ -2491,6 +2505,14 @@ export class BcfApi extends runtime.BaseAPI {

const queryParameters: any = {};

if (requestParameters.$filter !== undefined) {
queryParameters['$filter'] = requestParameters.$filter;
}

if (requestParameters.$orderby !== undefined) {
queryParameters['$orderby'] = requestParameters.$orderby;
}

if (requestParameters.format !== undefined) {
queryParameters['format'] = requestParameters.format;
}
Expand Down Expand Up @@ -2541,8 +2563,8 @@ export class BcfApi extends runtime.BaseAPI {
* This is not a standard route. It responds with all topics, their viewpoints and their comments Required scopes: bcf:read
* Retrieve all full topics
*/
async getFullTopics(projects_pk: number, format?: string, ifcs?: Array<number>, img_format?: GetFullTopicsImgFormatEnum, models?: Array<number>, initOverrides?: RequestInit): Promise<Array<FullTopic>> {
const response = await this.getFullTopicsRaw({ projects_pk: projects_pk, format: format, ifcs: ifcs, img_format: img_format, models: models }, initOverrides);
async getFullTopics(projects_pk: number, $filter?: string, $orderby?: string, format?: string, ifcs?: Array<number>, img_format?: GetFullTopicsImgFormatEnum, models?: Array<number>, initOverrides?: RequestInit): Promise<Array<FullTopic>> {
const response = await this.getFullTopicsRaw({ projects_pk: projects_pk, $filter: $filter, $orderby: $orderby, format: format, ifcs: ifcs, img_format: img_format, models: models }, initOverrides);
return await response.value();
}

Expand Down Expand Up @@ -2975,6 +2997,14 @@ export class BcfApi extends runtime.BaseAPI {

const queryParameters: any = {};

if (requestParameters.$filter !== undefined) {
queryParameters['$filter'] = requestParameters.$filter;
}

if (requestParameters.$orderby !== undefined) {
queryParameters['$orderby'] = requestParameters.$orderby;
}

if (requestParameters.format !== undefined) {
queryParameters['format'] = requestParameters.format;
}
Expand Down Expand Up @@ -3021,8 +3051,8 @@ export class BcfApi extends runtime.BaseAPI {
* Retrieve all topics Required scopes: bcf:read
* Retrieve all topics
*/
async getTopics(projects_pk: number, format?: string, ifcs?: Array<number>, models?: Array<number>, initOverrides?: RequestInit): Promise<Array<Topic>> {
const response = await this.getTopicsRaw({ projects_pk: projects_pk, format: format, ifcs: ifcs, models: models }, initOverrides);
async getTopics(projects_pk: number, $filter?: string, $orderby?: string, format?: string, ifcs?: Array<number>, models?: Array<number>, initOverrides?: RequestInit): Promise<Array<Topic>> {
const response = await this.getTopicsRaw({ projects_pk: projects_pk, $filter: $filter, $orderby: $orderby, format: format, ifcs: ifcs, models: models }, initOverrides);
return await response.value();
}

Expand Down
4 changes: 2 additions & 2 deletions package/src/apis/CollaborationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ export class CollaborationApi extends runtime.BaseAPI {
}

/**
* Create a document. If the document is one of {\'OBJ\', \'IFC\', \'POINT_CLOUD\', \'GLTF\', \'DXF\', \'DWG\'}, a model will be created and attached to this document Required scopes: document:write
* Create a document. If the document is one of {\'OBJ\', \'GLTF\', \'IFC\', \'DWG\', \'POINT_CLOUD\', \'DXF\'}, 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 @@ -1780,7 +1780,7 @@ export class CollaborationApi extends runtime.BaseAPI {
}

/**
* Create a document. If the document is one of {\'OBJ\', \'IFC\', \'POINT_CLOUD\', \'GLTF\', \'DXF\', \'DWG\'}, a model will be created and attached to this document Required scopes: document:write
* Create a document. If the document is one of {\'OBJ\', \'GLTF\', \'IFC\', \'DWG\', \'POINT_CLOUD\', \'DXF\'}, 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
24 changes: 12 additions & 12 deletions package/src/models/WriteFolderRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ import { exists, mapValues } from '../runtime';
* @interface WriteFolderRequest
*/
export interface WriteFolderRequest {
/**
* Permission for a Folder
*
* * `1` - denied
* * `50` - read_only
* * `100` - read_write
* @type {number}
* @memberof WriteFolderRequest
*/
default_permission?: WriteFolderRequestDefaultPermissionEnum;
/**
*
* @type {number}
Expand All @@ -31,16 +41,6 @@ export interface WriteFolderRequest {
* @memberof WriteFolderRequest
*/
name: string;
/**
* Permission for a Folder
*
* * `1` - denied
* * `50` - read_only
* * `100` - read_write
* @type {number}
* @memberof WriteFolderRequest
*/
default_permission?: WriteFolderRequestDefaultPermissionEnum;
/**
*
* @type {Array<WriteFolderRequest>}
Expand Down Expand Up @@ -69,9 +69,9 @@ export function WriteFolderRequestFromJSONTyped(json: any, ignoreDiscriminator:
}
return {

'default_permission': !exists(json, 'default_permission') ? undefined : json['default_permission'],
'parent_id': !exists(json, 'parent_id') ? undefined : json['parent_id'],
'name': json['name'],
'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,9 +85,9 @@ export function WriteFolderRequestToJSON(value?: WriteFolderRequest | null): any
}
return {

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

0 comments on commit e6cb0f2

Please sign in to comment.