Skip to content

Commit d28ef50

Browse files
committed
MINOR: add infos to users lists (#934)
* add infos to users lists * migrate in_all_projects * fix doc
1 parent 107f925 commit d28ef50

10 files changed

Lines changed: 255 additions & 123 deletions

File tree

package/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ src/models/TransformRequest.ts
251251
src/models/Unit.ts
252252
src/models/UnitRequest.ts
253253
src/models/User.ts
254+
src/models/UserCloud.ts
254255
src/models/UserInvitation.ts
255256
src/models/UserProject.ts
256257
src/models/UserProjectIdRequest.ts

package/src/apis/CollaborationApi.ts

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ import {
159159
User,
160160
UserFromJSON,
161161
UserToJSON,
162+
UserCloud,
163+
UserCloudFromJSON,
164+
UserCloudToJSON,
162165
UserInvitation,
163166
UserInvitationFromJSON,
164167
UserInvitationToJSON,
@@ -472,11 +475,6 @@ export interface GetCloudSizeRequest {
472475
id: number;
473476
}
474477

475-
export interface GetCloudUserRequest {
476-
cloud_pk: number;
477-
id: number;
478-
}
479-
480478
export interface GetCloudUsersRequest {
481479
cloud_pk: number;
482480
email?: string;
@@ -1693,7 +1691,7 @@ export class CollaborationApi extends runtime.BaseAPI {
16931691
}
16941692

16951693
/**
1696-
* Create a document. If the document is one of {\'GLTF\', \'OBJ\', \'PHOTOSPHERE\', \'DWG\', \'DXF\', \'POINT_CLOUD\', \'IFC\'}, a model will be created and attached to this document Required scopes: document:write
1694+
* Create a document. If the document is one of {\'OBJ\', \'IFC\', \'GLTF\', \'DWG\', \'DXF\', \'PHOTOSPHERE\', \'POINT_CLOUD\'}, a model will be created and attached to this document Required scopes: document:write
16971695
* Create a document
16981696
*/
16991697
async createDocumentRaw(requestParameters: CreateDocumentRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Document>> {
@@ -1800,7 +1798,7 @@ export class CollaborationApi extends runtime.BaseAPI {
18001798
}
18011799

18021800
/**
1803-
* Create a document. If the document is one of {\'GLTF\', \'OBJ\', \'PHOTOSPHERE\', \'DWG\', \'DXF\', \'POINT_CLOUD\', \'IFC\'}, a model will be created and attached to this document Required scopes: document:write
1801+
* Create a document. If the document is one of {\'OBJ\', \'IFC\', \'GLTF\', \'DWG\', \'DXF\', \'PHOTOSPHERE\', \'POINT_CLOUD\'}, a model will be created and attached to this document Required scopes: document:write
18041802
* Create a document
18051803
*/
18061804
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> {
@@ -3628,65 +3626,11 @@ export class CollaborationApi extends runtime.BaseAPI {
36283626
return await response.value();
36293627
}
36303628

3631-
/**
3632-
* Only administrators can see a cloud member Required scopes: cloud:read
3633-
* Retrieve a user in a cloud
3634-
*/
3635-
async getCloudUserRaw(requestParameters: GetCloudUserRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<User>> {
3636-
if (requestParameters.cloud_pk === null || requestParameters.cloud_pk === undefined) {
3637-
throw new runtime.RequiredError('cloud_pk','Required parameter requestParameters.cloud_pk was null or undefined when calling getCloudUser.');
3638-
}
3639-
3640-
if (requestParameters.id === null || requestParameters.id === undefined) {
3641-
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getCloudUser.');
3642-
}
3643-
3644-
const queryParameters: any = {};
3645-
3646-
const headerParameters: runtime.HTTPHeaders = {};
3647-
3648-
if (this.configuration && this.configuration.apiKey) {
3649-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
3650-
}
3651-
3652-
if (this.configuration && this.configuration.accessToken) {
3653-
// oauth required
3654-
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
3655-
}
3656-
3657-
if (this.configuration && this.configuration.accessToken) {
3658-
// oauth required
3659-
headerParameters["Authorization"] = await this.configuration.accessToken("BIMData_Connect", []);
3660-
}
3661-
3662-
if (this.configuration && this.configuration.apiKey) {
3663-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Bearer authentication
3664-
}
3665-
3666-
const response = await this.request({
3667-
path: `/cloud/{cloud_pk}/user/{id}`.replace(`{${"cloud_pk"}}`, encodeURIComponent(String(requestParameters.cloud_pk))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
3668-
method: 'GET',
3669-
headers: headerParameters,
3670-
query: queryParameters,
3671-
}, initOverrides);
3672-
3673-
return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue));
3674-
}
3675-
3676-
/**
3677-
* Only administrators can see a cloud member Required scopes: cloud:read
3678-
* Retrieve a user in a cloud
3679-
*/
3680-
async getCloudUser(cloud_pk: number, id: number, initOverrides?: RequestInit): Promise<User> {
3681-
const response = await this.getCloudUserRaw({ cloud_pk: cloud_pk, id: id }, initOverrides);
3682-
return await response.value();
3683-
}
3684-
36853629
/**
36863630
* Only administrators can see cloud members. Required scopes: cloud:read
36873631
* Retrieve all users in a cloud, or a list with a filter by email
36883632
*/
3689-
async getCloudUsersRaw(requestParameters: GetCloudUsersRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<User>>> {
3633+
async getCloudUsersRaw(requestParameters: GetCloudUsersRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<UserCloud>>> {
36903634
if (requestParameters.cloud_pk === null || requestParameters.cloud_pk === undefined) {
36913635
throw new runtime.RequiredError('cloud_pk','Required parameter requestParameters.cloud_pk was null or undefined when calling getCloudUsers.');
36923636
}
@@ -3736,14 +3680,14 @@ export class CollaborationApi extends runtime.BaseAPI {
37363680
query: queryParameters,
37373681
}, initOverrides);
37383682

3739-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserFromJSON));
3683+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserCloudFromJSON));
37403684
}
37413685

37423686
/**
37433687
* Only administrators can see cloud members. Required scopes: cloud:read
37443688
* Retrieve all users in a cloud, or a list with a filter by email
37453689
*/
3746-
async getCloudUsers(cloud_pk: number, email?: string, email__contains?: string, email__endswith?: string, email__startswith?: string, initOverrides?: RequestInit): Promise<Array<User>> {
3690+
async getCloudUsers(cloud_pk: number, email?: string, email__contains?: string, email__endswith?: string, email__startswith?: string, initOverrides?: RequestInit): Promise<Array<UserCloud>> {
37473691
const response = await this.getCloudUsersRaw({ cloud_pk: cloud_pk, email: email, email__contains: email__contains, email__endswith: email__endswith, email__startswith: email__startswith }, initOverrides);
37483692
return await response.value();
37493693
}

package/src/models/DocumentText.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export interface DocumentText {
3232
*/
3333
text?: string | null;
3434
/**
35-
* * `spanish` - spanish
3635
* * `german` - german
37-
* * `italian` - italian
38-
* * `english` - english
3936
* * `french` - french
37+
* * `spanish` - spanish
38+
* * `english` - english
39+
* * `italian` - italian
4040
* @type {string}
4141
* @memberof DocumentText
4242
*/
@@ -48,11 +48,11 @@ export interface DocumentText {
4848
* @enum {string}
4949
*/
5050
export enum DocumentTextLanguageEnum {
51-
Spanish = 'spanish',
5251
German = 'german',
53-
Italian = 'italian',
54-
English = 'english',
5552
French = 'french',
53+
Spanish = 'spanish',
54+
English = 'english',
55+
Italian = 'italian',
5656
Null = 'null'
5757
}
5858

package/src/models/FolderUserProject.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import { exists, mapValues } from '../runtime';
1616
/**
17-
* This is a flattened nested represetation of FosUser and Invitation models in this serializer.
17+
* This is a flattened nested representation of FosUser, Invitation, UserCloud and UserProject models in this serializer.
1818
* @export
1919
* @interface FolderUserProject
2020
*/
@@ -75,6 +75,19 @@ export interface FolderUserProject {
7575
* @memberof FolderUserProject
7676
*/
7777
readonly role: FolderUserProjectRoleEnum;
78+
/**
79+
* * `100` - admin
80+
* * `50` - user
81+
* @type {number}
82+
* @memberof FolderUserProject
83+
*/
84+
readonly cloud_role: FolderUserProjectCloudRoleEnum;
85+
/**
86+
*
87+
* @type {boolean}
88+
* @memberof FolderUserProject
89+
*/
90+
readonly in_all_projects: boolean;
7891
/**
7992
* * `1` - denied
8093
* * `50` - read_only
@@ -97,6 +110,13 @@ export enum FolderUserProjectRoleEnum {
97110
* @export
98111
* @enum {string}
99112
*/
113+
export enum FolderUserProjectCloudRoleEnum {
114+
NUMBER_100 = 100,
115+
NUMBER_50 = 50
116+
}/**
117+
* @export
118+
* @enum {string}
119+
*/
100120
export enum FolderUserProjectPermissionEnum {
101121
NUMBER_1 = 1,
102122
NUMBER_50 = 50,
@@ -122,6 +142,8 @@ export function FolderUserProjectFromJSONTyped(json: any, ignoreDiscriminator: b
122142
'profile_picture': json['profile_picture'],
123143
'sub': json['sub'],
124144
'role': json['role'],
145+
'cloud_role': json['cloud_role'],
146+
'in_all_projects': json['in_all_projects'],
125147
'permission': json['permission'],
126148
};
127149
}

package/src/models/PatchedDocumentTextRequest.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export interface PatchedDocumentTextRequest {
2626
*/
2727
text?: string | null;
2828
/**
29-
* * `spanish` - spanish
3029
* * `german` - german
31-
* * `italian` - italian
32-
* * `english` - english
3330
* * `french` - french
31+
* * `spanish` - spanish
32+
* * `english` - english
33+
* * `italian` - italian
3434
* @type {string}
3535
* @memberof PatchedDocumentTextRequest
3636
*/
@@ -42,11 +42,11 @@ export interface PatchedDocumentTextRequest {
4242
* @enum {string}
4343
*/
4444
export enum PatchedDocumentTextRequestLanguageEnum {
45-
Spanish = 'spanish',
4645
German = 'german',
47-
Italian = 'italian',
48-
English = 'english',
4946
French = 'french',
47+
Spanish = 'spanish',
48+
English = 'english',
49+
Italian = 'italian',
5050
Null = 'null'
5151
}
5252

package/src/models/UserCloud.ts

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
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: support@bimdata.io
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+
* This is a flattened nested representation of FosUser and UserCloud models in this serializer.
18+
* @export
19+
* @interface UserCloud
20+
*/
21+
export interface UserCloud {
22+
/**
23+
*
24+
* @type {number}
25+
* @memberof UserCloud
26+
*/
27+
readonly id: number;
28+
/**
29+
*
30+
* @type {number}
31+
* @memberof UserCloud
32+
*/
33+
readonly user_id: number | null;
34+
/**
35+
*
36+
* @type {string}
37+
* @memberof UserCloud
38+
*/
39+
readonly email: string;
40+
/**
41+
*
42+
* @type {string}
43+
* @memberof UserCloud
44+
*/
45+
readonly firstname: string | null;
46+
/**
47+
*
48+
* @type {string}
49+
* @memberof UserCloud
50+
*/
51+
readonly lastname: string | null;
52+
/**
53+
*
54+
* @type {string}
55+
* @memberof UserCloud
56+
*/
57+
readonly profile_picture: string | null;
58+
/**
59+
*
60+
* @type {string}
61+
* @memberof UserCloud
62+
*/
63+
readonly sub: string | null;
64+
/**
65+
*
66+
* @type {Date}
67+
* @memberof UserCloud
68+
*/
69+
readonly created_at: Date;
70+
/**
71+
*
72+
* @type {Date}
73+
* @memberof UserCloud
74+
*/
75+
readonly updated_at: Date;
76+
/**
77+
*
78+
* @type {string}
79+
* @memberof UserCloud
80+
*/
81+
readonly provider: string;
82+
/**
83+
* * `100` - admin
84+
* * `50` - user
85+
* @type {number}
86+
* @memberof UserCloud
87+
*/
88+
readonly cloud_role: UserCloudCloudRoleEnum;
89+
/**
90+
*
91+
* @type {boolean}
92+
* @memberof UserCloud
93+
*/
94+
readonly in_all_projects: boolean;
95+
}
96+
97+
/**
98+
* @export
99+
* @enum {string}
100+
*/
101+
export enum UserCloudCloudRoleEnum {
102+
NUMBER_100 = 100,
103+
NUMBER_50 = 50
104+
}
105+
106+
export function UserCloudFromJSON(json: any): UserCloud {
107+
return UserCloudFromJSONTyped(json, false);
108+
}
109+
110+
export function UserCloudFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserCloud {
111+
if ((json === undefined) || (json === null)) {
112+
return json;
113+
}
114+
return {
115+
116+
'id': json['id'],
117+
'user_id': json['user_id'],
118+
'email': json['email'],
119+
'firstname': json['firstname'],
120+
'lastname': json['lastname'],
121+
'profile_picture': json['profile_picture'],
122+
'sub': json['sub'],
123+
'created_at': (new Date(json['created_at'])),
124+
'updated_at': (new Date(json['updated_at'])),
125+
'provider': json['provider'],
126+
'cloud_role': json['cloud_role'],
127+
'in_all_projects': json['in_all_projects'],
128+
};
129+
}
130+
131+
export function UserCloudToJSON(value?: UserCloud | null): any {
132+
if (value === undefined) {
133+
return undefined;
134+
}
135+
if (value === null) {
136+
return null;
137+
}
138+
return {
139+
140+
};
141+
}
142+

0 commit comments

Comments
 (0)