profile http api updates

This commit is contained in:
Timo 2021-04-07 15:16:33 +03:00
parent f38b2e9600
commit 35767fe675
4 changed files with 88 additions and 5 deletions

View File

@ -24,6 +24,7 @@ import { UserSearchResponse } from '../model/userSearchResponse';
import { BASE_PATH } from '../variables';
import { Configuration } from '../configuration';
import { UpdateMyProfileRequest } from '../model/updateMyProfileRequest';
@Injectable()
export class UserControllerService {
@ -379,10 +380,10 @@ export class UserControllerService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public updateProfile(body: UpdateProfileRequest, observe?: 'body', reportProgress?: boolean): Observable<any>;
public updateProfile(body: UpdateProfileRequest, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public updateProfile(body: UpdateProfileRequest, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public updateProfile(body: UpdateProfileRequest, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'body', reportProgress?: boolean): Observable<any>;
public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public updateMyProfile(body: UpdateMyProfileRequest, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling updateProfile.');
}
@ -409,7 +410,58 @@ export class UserControllerService {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.request<any>('post', `${this.basePath}/user/profile`, {
return this.httpClient.request<any>('post', `${this.basePath}/user/my-profile`, {
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* Update a users profile. Invoked by admin.
* None
* @param body updateProfileRequest
* @param userId userId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public updateProfile(body: UpdateProfileRequest, userId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public updateProfile(body: UpdateProfileRequest, userId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public updateProfile(body: UpdateProfileRequest, userId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public updateProfile(body: UpdateProfileRequest, userId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling updateProfile1.');
}
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling updateProfile1.');
}
let headers = this.defaultHeaders;
// authentication (RED-OAUTH) required
if (this.configuration.accessToken) {
const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = [];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.request<any>('post', `${this.basePath}/user/profile/${encodeURIComponent(String(userId))}`, {
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,

View File

@ -70,3 +70,4 @@ export * from './sMTPConfigurationModel';
export * from './userSearchRequest';
export * from './userSearchResponse';
export * from './updateProfileRequest';
export * from './updateMyProfileRequest';

View File

@ -0,0 +1,26 @@
/**
* API Documentation for Redaction Gateway
* Description for redaction
*
* OpenAPI spec version: 1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
export interface UpdateMyProfileRequest {
/**
* Email of user.
*/
email?: string;
/**
* First name of user.
*/
firstName?: string;
/**
* Last name of user.
*/
lastName?: string;
}

View File

@ -23,4 +23,8 @@ export interface UpdateProfileRequest {
* Last name of user.
*/
lastName?: string;
/**
* Roles.
*/
roles?: Array<string>;
}