Skip to content

Commit 0775a8f

Browse files
chore: update API specs and client
1 parent d57d93e commit 0775a8f

File tree

6 files changed

+201
-0
lines changed

6 files changed

+201
-0
lines changed

server/application-server/openapi.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,35 @@ paths:
218218
responses:
219219
"200":
220220
description: OK
221+
/user/settings:
222+
get:
223+
tags:
224+
- user
225+
operationId: getUserSettings
226+
responses:
227+
"200":
228+
description: OK
229+
content:
230+
application/json:
231+
schema:
232+
$ref: "#/components/schemas/UserSettings"
233+
post:
234+
tags:
235+
- user
236+
operationId: updateUserSettings
237+
requestBody:
238+
content:
239+
application/json:
240+
schema:
241+
$ref: "#/components/schemas/UserSettings"
242+
required: true
243+
responses:
244+
"200":
245+
description: OK
246+
content:
247+
application/json:
248+
schema:
249+
$ref: "#/components/schemas/UserSettings"
221250
/mentor/sessions:
222251
get:
223252
tags:
@@ -580,6 +609,11 @@ components:
580609
- id
581610
- name
582611
- nameWithOwner
612+
UserSettings:
613+
type: object
614+
properties:
615+
receiveNotifications:
616+
type: boolean
583617
UserTeams:
584618
type: object
585619
properties:

webapp/src/app/core/modules/openapi/.openapi-generator/FILES

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ model/session.ts
3434
model/team-info.ts
3535
model/user-info.ts
3636
model/user-profile.ts
37+
model/user-settings.ts
3738
model/user-teams.ts
3839
param.ts
3940
variables.ts

webapp/src/app/core/modules/openapi/api/user.service.ts

+134
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { Observable } from 'rxjs';
2020

2121
// @ts-ignore
2222
import { UserProfile } from '../model/user-profile';
23+
// @ts-ignore
24+
import { UserSettings } from '../model/user-settings';
2325

2426
// @ts-ignore
2527
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -216,4 +218,136 @@ export class UserService implements UserServiceInterface {
216218
);
217219
}
218220

221+
/**
222+
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
223+
* @param reportProgress flag to report request and response progress.
224+
*/
225+
public getUserSettings(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<UserSettings>;
226+
public getUserSettings(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserSettings>>;
227+
public getUserSettings(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserSettings>>;
228+
public getUserSettings(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
229+
230+
let localVarHeaders = this.defaultHeaders;
231+
232+
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
233+
if (localVarHttpHeaderAcceptSelected === undefined) {
234+
// to determine the Accept header
235+
const httpHeaderAccepts: string[] = [
236+
'application/json'
237+
];
238+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
239+
}
240+
if (localVarHttpHeaderAcceptSelected !== undefined) {
241+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
242+
}
243+
244+
let localVarHttpContext: HttpContext | undefined = options && options.context;
245+
if (localVarHttpContext === undefined) {
246+
localVarHttpContext = new HttpContext();
247+
}
248+
249+
let localVarTransferCache: boolean | undefined = options && options.transferCache;
250+
if (localVarTransferCache === undefined) {
251+
localVarTransferCache = true;
252+
}
253+
254+
255+
let responseType_: 'text' | 'json' | 'blob' = 'json';
256+
if (localVarHttpHeaderAcceptSelected) {
257+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
258+
responseType_ = 'text';
259+
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
260+
responseType_ = 'json';
261+
} else {
262+
responseType_ = 'blob';
263+
}
264+
}
265+
266+
let localVarPath = `/user/settings`;
267+
return this.httpClient.request<UserSettings>('get', `${this.configuration.basePath}${localVarPath}`,
268+
{
269+
context: localVarHttpContext,
270+
responseType: <any>responseType_,
271+
withCredentials: this.configuration.withCredentials,
272+
headers: localVarHeaders,
273+
observe: observe,
274+
transferCache: localVarTransferCache,
275+
reportProgress: reportProgress
276+
}
277+
);
278+
}
279+
280+
/**
281+
* @param userSettings
282+
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
283+
* @param reportProgress flag to report request and response progress.
284+
*/
285+
public updateUserSettings(userSettings: UserSettings, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<UserSettings>;
286+
public updateUserSettings(userSettings: UserSettings, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserSettings>>;
287+
public updateUserSettings(userSettings: UserSettings, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserSettings>>;
288+
public updateUserSettings(userSettings: UserSettings, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
289+
if (userSettings === null || userSettings === undefined) {
290+
throw new Error('Required parameter userSettings was null or undefined when calling updateUserSettings.');
291+
}
292+
293+
let localVarHeaders = this.defaultHeaders;
294+
295+
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
296+
if (localVarHttpHeaderAcceptSelected === undefined) {
297+
// to determine the Accept header
298+
const httpHeaderAccepts: string[] = [
299+
'application/json'
300+
];
301+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
302+
}
303+
if (localVarHttpHeaderAcceptSelected !== undefined) {
304+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
305+
}
306+
307+
let localVarHttpContext: HttpContext | undefined = options && options.context;
308+
if (localVarHttpContext === undefined) {
309+
localVarHttpContext = new HttpContext();
310+
}
311+
312+
let localVarTransferCache: boolean | undefined = options && options.transferCache;
313+
if (localVarTransferCache === undefined) {
314+
localVarTransferCache = true;
315+
}
316+
317+
318+
// to determine the Content-Type header
319+
const consumes: string[] = [
320+
'application/json'
321+
];
322+
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
323+
if (httpContentTypeSelected !== undefined) {
324+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
325+
}
326+
327+
let responseType_: 'text' | 'json' | 'blob' = 'json';
328+
if (localVarHttpHeaderAcceptSelected) {
329+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
330+
responseType_ = 'text';
331+
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
332+
responseType_ = 'json';
333+
} else {
334+
responseType_ = 'blob';
335+
}
336+
}
337+
338+
let localVarPath = `/user/settings`;
339+
return this.httpClient.request<UserSettings>('post', `${this.configuration.basePath}${localVarPath}`,
340+
{
341+
context: localVarHttpContext,
342+
body: userSettings,
343+
responseType: <any>responseType_,
344+
withCredentials: this.configuration.withCredentials,
345+
headers: localVarHeaders,
346+
observe: observe,
347+
transferCache: localVarTransferCache,
348+
reportProgress: reportProgress
349+
}
350+
);
351+
}
352+
219353
}

webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts

+14
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { HttpHeaders } from '@angular/comm
1414
import { Observable } from 'rxjs';
1515

1616
import { UserProfile } from '../model/models';
17+
import { UserSettings } from '../model/models';
1718

1819

1920
import { Configuration } from '../configuration';
@@ -37,4 +38,17 @@ export interface UserServiceInterface {
3738
*/
3839
getUserProfile(login: string, extraHttpRequestParams?: any): Observable<UserProfile>;
3940

41+
/**
42+
*
43+
*
44+
*/
45+
getUserSettings(extraHttpRequestParams?: any): Observable<UserSettings>;
46+
47+
/**
48+
*
49+
*
50+
* @param userSettings
51+
*/
52+
updateUserSettings(userSettings: UserSettings, extraHttpRequestParams?: any): Observable<UserSettings>;
53+
4054
}

webapp/src/app/core/modules/openapi/model/models.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export * from './session';
1010
export * from './team-info';
1111
export * from './user-info';
1212
export * from './user-profile';
13+
export * from './user-settings';
1314
export * from './user-teams';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Hephaestus API
3+
* API documentation for the Hephaestus application server.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
export interface UserSettings {
15+
receiveNotifications?: boolean;
16+
}
17+

0 commit comments

Comments
 (0)