updated project controller http generated code

This commit is contained in:
Timo Bejan 2020-10-20 11:54:05 +03:00
parent cd52a3b747
commit cb30883183
5 changed files with 206 additions and 36 deletions

View File

@ -3,7 +3,7 @@
## Swagger Generated Code
To regnerate http rune swaagger
```
URL=http://ingress.redaction-timo-dev-0304.178.63.47.73.xip.io/v2/api-docs?group=redaction-gateway-v1
URL=https://timo-redaction-dev.iqser.cloud/v2/api-docs?group=redaction-gateway-v1
mkdir -p /tmp/swagger
swagger-codegen generate -i "$URL" -l typescript-angular -o /tmp/swagger
```

View File

@ -16,6 +16,7 @@ import {HttpClient, HttpEvent, HttpHeaders, HttpResponse} from '@angular/common/
import {Observable} from 'rxjs';
import {Project} from '../model/project';
import {ProjectMembers} from '../model/projectMembers';
import {ProjectRequest} from '../model/projectRequest';
import {BASE_PATH} from '../variables';
@ -25,9 +26,9 @@ import {Configuration} from '../configuration';
@Injectable()
export class ProjectControllerService {
protected basePath = '';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();
protected basePath = '';
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
if (basePath) {
@ -39,6 +40,130 @@ export class ProjectControllerService {
}
}
/**
* @param consumes string[] mime-types
* @return true: consumes contains 'multipart/form-data', false: otherwise
*/
private canConsumeForm(consumes: string[]): boolean {
const form = 'multipart/form-data';
for (const consume of consumes) {
if (form === consume) {
return true;
}
}
return false;
}
/**
* Adds members to project.
* None
* @param body projectMembers
* @param projectId projectId
* @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 addMembersToProject(body: ProjectMembers, projectId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public addMembersToProject(body: ProjectMembers, projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public addMembersToProject(body: ProjectMembers, projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public addMembersToProject(body: ProjectMembers, projectId: 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 addMembersToProject.');
}
if (projectId === null || projectId === undefined) {
throw new Error('Required parameter projectId was null or undefined when calling addMembersToProject.');
}
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}/project/members/${encodeURIComponent(String(projectId))}`,
{
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
}
);
}
/**
* Assigns new owner to project.
* None
* @param projectId projectId
* @param ownerId ownerId
* @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 assignProjectOwner(projectId: string, ownerId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public assignProjectOwner(projectId: string, ownerId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public assignProjectOwner(projectId: string, ownerId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public assignProjectOwner(projectId: string, ownerId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (projectId === null || projectId === undefined) {
throw new Error('Required parameter projectId was null or undefined when calling assignProjectOwner.');
}
if (ownerId === null || ownerId === undefined) {
throw new Error('Required parameter ownerId was null or undefined when calling assignProjectOwner.');
}
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[] = [];
return this.httpClient.request<any>('post', `${this.basePath}/project/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(ownerId))}`,
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
}
);
}
/**
* Creates a new project.
* None
@ -47,11 +172,8 @@ export class ProjectControllerService {
* @param reportProgress flag to report request and response progress.
*/
public createProject(body: ProjectRequest, observe?: 'body', reportProgress?: boolean): Observable<Project>;
public createProject(body: ProjectRequest, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Project>>;
public createProject(body: ProjectRequest, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Project>>;
public createProject(body: ProjectRequest, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (body === null || body === undefined) {
@ -97,6 +219,64 @@ export class ProjectControllerService {
);
}
/**
* Deletes members from project.
* None
* @param body projectMembers
* @param projectId projectId
* @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 deleteMembersToProject(body: ProjectMembers, projectId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public deleteMembersToProject(body: ProjectMembers, projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public deleteMembersToProject(body: ProjectMembers, projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public deleteMembersToProject(body: ProjectMembers, projectId: 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 deleteMembersToProject.');
}
if (projectId === null || projectId === undefined) {
throw new Error('Required parameter projectId was null or undefined when calling deleteMembersToProject.');
}
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[] = [
'*/*'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.request<any>('delete', `${this.basePath}/project/members/${encodeURIComponent(String(projectId))}`,
{
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
}
);
}
/**
* Deletes an existing project.
* None
@ -105,11 +285,8 @@ export class ProjectControllerService {
* @param reportProgress flag to report request and response progress.
*/
public deleteProject(projectId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public deleteProject(projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public deleteProject(projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public deleteProject(projectId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (projectId === null || projectId === undefined) {
@ -154,11 +331,8 @@ export class ProjectControllerService {
* @param reportProgress flag to report request and response progress.
*/
public getProject(projectId: string, observe?: 'body', reportProgress?: boolean): Observable<Project>;
public getProject(projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Project>>;
public getProject(projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Project>>;
public getProject(projectId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (projectId === null || projectId === undefined) {
@ -204,11 +378,8 @@ export class ProjectControllerService {
* @param reportProgress flag to report request and response progress.
*/
public getProjects(observe?: 'body', reportProgress?: boolean): Observable<Array<Project>>;
public getProjects(observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<Project>>>;
public getProjects(observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<Project>>>;
public getProjects(observe: any = 'body', reportProgress: boolean = false): Observable<any> {
let headers = this.defaultHeaders;
@ -252,11 +423,8 @@ export class ProjectControllerService {
* @param reportProgress flag to report request and response progress.
*/
public updateProject(body: ProjectRequest, projectId: string, observe?: 'body', reportProgress?: boolean): Observable<Project>;
public updateProject(body: ProjectRequest, projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Project>>;
public updateProject(body: ProjectRequest, projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Project>>;
public updateProject(body: ProjectRequest, projectId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (body === null || body === undefined) {
@ -306,18 +474,4 @@ export class ProjectControllerService {
);
}
/**
* @param consumes string[] mime-types
* @return true: consumes contains 'multipart/form-data', false: otherwise
*/
private canConsumeForm(consumes: string[]): boolean {
const form = 'multipart/form-data';
for (const consume of consumes) {
if (form === consume) {
return true;
}
}
return false;
}
}

View File

@ -31,3 +31,4 @@ export * from './updateTypeValue';
export * from './user';
export * from './userRequest';
export * from './userResponse';
export * from './projectMembers';

View File

@ -0,0 +1,15 @@
/**
* 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 ProjectMembers {
memberIds?: Array<string>;
}

View File

@ -3,14 +3,14 @@
* 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 ProjectRequest {
projectName?: string;
description?: string;
}
export interface ProjectRequest {
projectName?: string;
description?: string;
}