Skip to content

Commit d5b3c8d

Browse files
committed
MINOR: add BCF topic/pins route (#855)
* MINOR: add BCF topic/pins route * add topic guid filter test
1 parent b2772e3 commit d5b3c8d

File tree

8 files changed

+288
-40
lines changed

8 files changed

+288
-40
lines changed

package/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ src/models/PerspectiveCamera.ts
147147
src/models/PerspectiveCameraRequest.ts
148148
src/models/Pin.ts
149149
src/models/PinRequest.ts
150+
src/models/PinWithModels.ts
150151
src/models/Point.ts
151152
src/models/PointRequest.ts
152153
src/models/PositioningPlan.ts
@@ -219,6 +220,7 @@ src/models/Tag.ts
219220
src/models/TagIdRequest.ts
220221
src/models/TagRequest.ts
221222
src/models/Topic.ts
223+
src/models/TopicPin.ts
222224
src/models/TopicRequest.ts
223225
src/models/TopicStatus.ts
224226
src/models/TopicStatusRequest.ts

package/src/apis/BcfApi.ts

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ import {
111111
Topic,
112112
TopicFromJSON,
113113
TopicToJSON,
114+
TopicPin,
115+
TopicPinFromJSON,
116+
TopicPinToJSON,
114117
TopicRequest,
115118
TopicRequestFromJSON,
116119
TopicRequestToJSON,
@@ -393,6 +396,14 @@ export interface GetTopicsRequest {
393396
models?: Array<number>;
394397
}
395398

399+
export interface GetTopicsPinsRequest {
400+
projects_pk: number;
401+
format?: string;
402+
ifcs?: Array<number>;
403+
models?: Array<number>;
404+
topics?: string;
405+
}
406+
396407
export interface GetViewpoinPinRequest {
397408
guid: string;
398409
projects_pk: number;
@@ -3056,6 +3067,72 @@ export class BcfApi extends runtime.BaseAPI {
30563067
return await response.value();
30573068
}
30583069

3070+
/**
3071+
* This is not a standard route. Get pins of all or many topics Required scopes: bcf:read
3072+
* Get pins of all or many topics
3073+
*/
3074+
async getTopicsPinsRaw(requestParameters: GetTopicsPinsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<TopicPin>>> {
3075+
if (requestParameters.projects_pk === null || requestParameters.projects_pk === undefined) {
3076+
throw new runtime.RequiredError('projects_pk','Required parameter requestParameters.projects_pk was null or undefined when calling getTopicsPins.');
3077+
}
3078+
3079+
const queryParameters: any = {};
3080+
3081+
if (requestParameters.format !== undefined) {
3082+
queryParameters['format'] = requestParameters.format;
3083+
}
3084+
3085+
if (requestParameters.ifcs) {
3086+
queryParameters['ifcs'] = requestParameters.ifcs;
3087+
}
3088+
3089+
if (requestParameters.models) {
3090+
queryParameters['models'] = requestParameters.models;
3091+
}
3092+
3093+
if (requestParameters.topics !== undefined) {
3094+
queryParameters['topics'] = requestParameters.topics;
3095+
}
3096+
3097+
const headerParameters: runtime.HTTPHeaders = {};
3098+
3099+
if (this.configuration && this.configuration.apiKey) {
3100+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
3101+
}
3102+
3103+
if (this.configuration && this.configuration.accessToken) {
3104+
// oauth required
3105+
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
3106+
}
3107+
3108+
if (this.configuration && this.configuration.accessToken) {
3109+
// oauth required
3110+
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
3111+
}
3112+
3113+
if (this.configuration && this.configuration.apiKey) {
3114+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Bearer authentication
3115+
}
3116+
3117+
const response = await this.request({
3118+
path: `/bcf/2.1/projects/{projects_pk}/topics/pins`.replace(`{${"projects_pk"}}`, encodeURIComponent(String(requestParameters.projects_pk))),
3119+
method: 'GET',
3120+
headers: headerParameters,
3121+
query: queryParameters,
3122+
}, initOverrides);
3123+
3124+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TopicPinFromJSON));
3125+
}
3126+
3127+
/**
3128+
* This is not a standard route. Get pins of all or many topics Required scopes: bcf:read
3129+
* Get pins of all or many topics
3130+
*/
3131+
async getTopicsPins(projects_pk: number, format?: string, ifcs?: Array<number>, models?: Array<number>, topics?: string, initOverrides?: RequestInit): Promise<Array<TopicPin>> {
3132+
const response = await this.getTopicsPinsRaw({ projects_pk: projects_pk, format: format, ifcs: ifcs, models: models, topics: topics }, initOverrides);
3133+
return await response.value();
3134+
}
3135+
30593136
/**
30603137
* Get current user info. If request comes from an App, the response is always:{ \"id\": None, \"name\": None, \"is_client\": True,} Required scopes: bcf:read
30613138
* Get current user info

package/src/apis/CollaborationApi.ts

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

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

17801780
/**
1781-
* Create a document. If the document is one of {\'POINT_CLOUD\', \'DWG\', \'OBJ\', \'DXF\', \'IFC\', \'GLTF\'}, a model will be created and attached to this document Required scopes: document:write
1781+
* Create a document. If the document is one of {\'DXF\', \'DWG\', \'POINT_CLOUD\', \'OBJ\', \'IFC\', \'GLTF\'}, a model will be created and attached to this document Required scopes: document:write
17821782
* Create a document
17831783
*/
17841784
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> {

package/src/models/PinWithModels.ts

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
import {
17+
GeometryPoint,
18+
GeometryPointFromJSON,
19+
GeometryPointFromJSONTyped,
20+
GeometryPointToJSON,
21+
} from './GeometryPoint';
22+
23+
/**
24+
*
25+
* @export
26+
* @interface PinWithModels
27+
*/
28+
export interface PinWithModels {
29+
/**
30+
*
31+
* @type {string}
32+
* @memberof PinWithModels
33+
*/
34+
readonly guid: string;
35+
/**
36+
*
37+
* @type {string}
38+
* @memberof PinWithModels
39+
*/
40+
readonly name: string | null;
41+
/**
42+
*
43+
* @type {string}
44+
* @memberof PinWithModels
45+
*/
46+
readonly color: string | null;
47+
/**
48+
*
49+
* @type {GeometryPoint}
50+
* @memberof PinWithModels
51+
*/
52+
point: GeometryPoint;
53+
/**
54+
*
55+
* @type {number}
56+
* @memberof PinWithModels
57+
*/
58+
readonly index: number | null;
59+
/**
60+
*
61+
* @type {Array<number>}
62+
* @memberof PinWithModels
63+
*/
64+
readonly model_ids: Array<number>;
65+
}
66+
67+
export function PinWithModelsFromJSON(json: any): PinWithModels {
68+
return PinWithModelsFromJSONTyped(json, false);
69+
}
70+
71+
export function PinWithModelsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PinWithModels {
72+
if ((json === undefined) || (json === null)) {
73+
return json;
74+
}
75+
return {
76+
77+
'guid': json['guid'],
78+
'name': json['name'],
79+
'color': json['color'],
80+
'point': GeometryPointFromJSON(json['point']),
81+
'index': json['index'],
82+
'model_ids': json['model_ids'],
83+
};
84+
}
85+
86+
export function PinWithModelsToJSON(value?: PinWithModels | null): any {
87+
if (value === undefined) {
88+
return undefined;
89+
}
90+
if (value === null) {
91+
return null;
92+
}
93+
return {
94+
95+
'point': GeometryPointToJSON(value.point),
96+
};
97+
}
98+

package/src/models/TopicPin.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
import {
17+
PinWithModels,
18+
PinWithModelsFromJSON,
19+
PinWithModelsFromJSONTyped,
20+
PinWithModelsToJSON,
21+
} from './PinWithModels';
22+
23+
/**
24+
*
25+
* @export
26+
* @interface TopicPin
27+
*/
28+
export interface TopicPin {
29+
/**
30+
*
31+
* @type {string}
32+
* @memberof TopicPin
33+
*/
34+
readonly topic_guid: string;
35+
/**
36+
*
37+
* @type {Array<PinWithModels>}
38+
* @memberof TopicPin
39+
*/
40+
readonly pins: Array<PinWithModels>;
41+
}
42+
43+
export function TopicPinFromJSON(json: any): TopicPin {
44+
return TopicPinFromJSONTyped(json, false);
45+
}
46+
47+
export function TopicPinFromJSONTyped(json: any, ignoreDiscriminator: boolean): TopicPin {
48+
if ((json === undefined) || (json === null)) {
49+
return json;
50+
}
51+
return {
52+
53+
'topic_guid': json['topic_guid'],
54+
'pins': ((json['pins'] as Array<any>).map(PinWithModelsFromJSON)),
55+
};
56+
}
57+
58+
export function TopicPinToJSON(value?: TopicPin | null): any {
59+
if (value === undefined) {
60+
return undefined;
61+
}
62+
if (value === null) {
63+
return null;
64+
}
65+
return {
66+
67+
};
68+
}
69+

0 commit comments

Comments
 (0)