Files
pkgdash/ui/src/app/api/services/pkgdash-service.service.ts
Vasiliy Tolstov ad798713df init ui
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-08-12 16:24:50 +03:00

268 lines
8.6 KiB
TypeScript

/* tslint:disable */
/* eslint-disable */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { StrictHttpResponse } from '../strict-http-response';
import { RequestBuilder } from '../request-builder';
import { AddCommentReq } from '../models/add-comment-req';
import { AddCommentRsp } from '../models/add-comment-rsp';
import { AddPackageReq } from '../models/add-package-req';
import { AddPackageRsp } from '../models/add-package-rsp';
import { GetModuleRsp } from '../models/get-module-rsp';
import { ListPackageRsp } from '../models/list-package-rsp';
import { UInt64Value } from '../models/u-int-64-value';
import { UpdatePackageReq } from '../models/update-package-req';
import { UpdatePackageRsp } from '../models/update-package-rsp';
@Injectable({ providedIn: 'root' })
export class PkgdashServiceService extends BaseService {
constructor(config: ApiConfiguration, http: HttpClient) {
super(config, http);
}
/** Path part for operation `getModule()` */
static readonly GetModulePath = '/v1/module';
/**
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `getModule()` instead.
*
* This method doesn't expect any request body.
*/
getModule$Response(
params?: {
id?: Array<number>;
},
context?: HttpContext
): Observable<StrictHttpResponse<GetModuleRsp>> {
const rb = new RequestBuilder(this.rootUrl, PkgdashServiceService.GetModulePath, 'get');
if (params) {
rb.query('id', params.id, {});
}
return this.http.request(
rb.build({ responseType: 'json', accept: 'application/json', context })
).pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<GetModuleRsp>;
})
);
}
/**
* This method provides access only to the response body.
* To access the full response (for headers, for example), `getModule$Response()` instead.
*
* This method doesn't expect any request body.
*/
getModule(
params?: {
id?: Array<number>;
},
context?: HttpContext
): Observable<GetModuleRsp> {
return this.getModule$Response(params, context).pipe(
map((r: StrictHttpResponse<GetModuleRsp>): GetModuleRsp => r.body)
);
}
/** Path part for operation `addPackage()` */
static readonly AddPackagePath = '/v1/package';
/**
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `addPackage()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
addPackage$Response(
params: {
body: AddPackageReq
},
context?: HttpContext
): Observable<StrictHttpResponse<AddPackageRsp>> {
const rb = new RequestBuilder(this.rootUrl, PkgdashServiceService.AddPackagePath, 'post');
if (params) {
rb.body(params.body, 'application/json');
}
return this.http.request(
rb.build({ responseType: 'json', accept: 'application/json', context })
).pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<AddPackageRsp>;
})
);
}
/**
* This method provides access only to the response body.
* To access the full response (for headers, for example), `addPackage$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
addPackage(
params: {
body: AddPackageReq
},
context?: HttpContext
): Observable<AddPackageRsp> {
return this.addPackage$Response(params, context).pipe(
map((r: StrictHttpResponse<AddPackageRsp>): AddPackageRsp => r.body)
);
}
/** Path part for operation `updateInfo()` */
static readonly UpdateInfoPath = '/v1/package/{id}';
/**
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `updateInfo()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
updateInfo$Response(
params: {
id: UInt64Value;
body: UpdatePackageReq
},
context?: HttpContext
): Observable<StrictHttpResponse<UpdatePackageRsp>> {
const rb = new RequestBuilder(this.rootUrl, PkgdashServiceService.UpdateInfoPath, 'post');
if (params) {
rb.path('id', params.id, {});
rb.body(params.body, 'application/json');
}
return this.http.request(
rb.build({ responseType: 'json', accept: 'application/json', context })
).pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<UpdatePackageRsp>;
})
);
}
/**
* This method provides access only to the response body.
* To access the full response (for headers, for example), `updateInfo$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
updateInfo(
params: {
id: UInt64Value;
body: UpdatePackageReq
},
context?: HttpContext
): Observable<UpdatePackageRsp> {
return this.updateInfo$Response(params, context).pipe(
map((r: StrictHttpResponse<UpdatePackageRsp>): UpdatePackageRsp => r.body)
);
}
/** Path part for operation `addComment()` */
static readonly AddCommentPath = '/v1/package/{pkg}/comment';
/**
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `addComment()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
addComment$Response(
params: {
pkg: string;
body: AddCommentReq
},
context?: HttpContext
): Observable<StrictHttpResponse<AddCommentRsp>> {
const rb = new RequestBuilder(this.rootUrl, PkgdashServiceService.AddCommentPath, 'post');
if (params) {
rb.path('pkg', params.pkg, {});
rb.body(params.body, 'application/json');
}
return this.http.request(
rb.build({ responseType: 'json', accept: 'application/json', context })
).pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<AddCommentRsp>;
})
);
}
/**
* This method provides access only to the response body.
* To access the full response (for headers, for example), `addComment$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
addComment(
params: {
pkg: string;
body: AddCommentReq
},
context?: HttpContext
): Observable<AddCommentRsp> {
return this.addComment$Response(params, context).pipe(
map((r: StrictHttpResponse<AddCommentRsp>): AddCommentRsp => r.body)
);
}
/** Path part for operation `listPackage()` */
static readonly ListPackagePath = '/v1/packages';
/**
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `listPackage()` instead.
*
* This method doesn't expect any request body.
*/
listPackage$Response(
params?: {
},
context?: HttpContext
): Observable<StrictHttpResponse<ListPackageRsp>> {
const rb = new RequestBuilder(this.rootUrl, PkgdashServiceService.ListPackagePath, 'get');
if (params) {
}
return this.http.request(
rb.build({ responseType: 'json', accept: 'application/json', context })
).pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<ListPackageRsp>;
})
);
}
/**
* This method provides access only to the response body.
* To access the full response (for headers, for example), `listPackage$Response()` instead.
*
* This method doesn't expect any request body.
*/
listPackage(
params?: {
},
context?: HttpContext
): Observable<ListPackageRsp> {
return this.listPackage$Response(params, context).pipe(
map((r: StrictHttpResponse<ListPackageRsp>): ListPackageRsp => r.body)
);
}
}