220 lines
5.2 KiB
TypeScript
220 lines
5.2 KiB
TypeScript
/* tslint:disable */
|
|
import { Injectable } from '@angular/core';
|
|
import { HttpClient, HttpRequest, HttpResponse, HttpHeaders } from '@angular/common/http';
|
|
import { BaseService as __BaseService } from '../base-service';
|
|
import { ApiConfiguration as __Configuration } from '../api-configuration';
|
|
import { StrictHttpResponse as __StrictHttpResponse } from '../strict-http-response';
|
|
import { Observable as __Observable } from 'rxjs';
|
|
import { map as __map, filter as __filter } from 'rxjs/operators';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
class ValuesService extends __BaseService {
|
|
static readonly GetPath = '/api/test';
|
|
static readonly PostPath = '/api/test';
|
|
static readonly Get_1Path = '/api/test/{id}';
|
|
static readonly PutPath = '/api/test/{id}';
|
|
static readonly DeletePath = '/api/test/{id}';
|
|
|
|
constructor(
|
|
config: __Configuration,
|
|
http: HttpClient
|
|
) {
|
|
super(config, http);
|
|
}
|
|
|
|
/**
|
|
* @return Success
|
|
*/
|
|
GetResponse(): __Observable<__StrictHttpResponse<Array<string>>> {
|
|
let __params = this.newParams();
|
|
let __headers = new HttpHeaders();
|
|
let __body: any = null;
|
|
let req = new HttpRequest<any>(
|
|
'GET',
|
|
this.rootUrl + `/api/test`,
|
|
__body,
|
|
{
|
|
headers: __headers,
|
|
params: __params,
|
|
responseType: 'json'
|
|
});
|
|
|
|
return this.http.request<any>(req).pipe(
|
|
__filter(_r => _r instanceof HttpResponse),
|
|
__map((_r) => {
|
|
return _r as __StrictHttpResponse<Array<string>>;
|
|
})
|
|
);
|
|
}
|
|
/**
|
|
* @return Success
|
|
*/
|
|
Get(): __Observable<Array<string>> {
|
|
return this.GetResponse().pipe(
|
|
__map(_r => _r.body as Array<string>)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @param value undefined
|
|
*/
|
|
PostResponse(value?: string): __Observable<__StrictHttpResponse<null>> {
|
|
let __params = this.newParams();
|
|
let __headers = new HttpHeaders();
|
|
let __body: any = null;
|
|
__body = value;
|
|
let req = new HttpRequest<any>(
|
|
'POST',
|
|
this.rootUrl + `/api/test`,
|
|
__body,
|
|
{
|
|
headers: __headers,
|
|
params: __params,
|
|
responseType: 'json'
|
|
});
|
|
|
|
return this.http.request<any>(req).pipe(
|
|
__filter(_r => _r instanceof HttpResponse),
|
|
__map((_r) => {
|
|
return _r as __StrictHttpResponse<null>;
|
|
})
|
|
);
|
|
}
|
|
/**
|
|
* @param value undefined
|
|
*/
|
|
Post(value?: string): __Observable<null> {
|
|
return this.PostResponse(value).pipe(
|
|
__map(_r => _r.body as null)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @param id undefined
|
|
* @return Success
|
|
*/
|
|
Get_1Response(id: number): __Observable<__StrictHttpResponse<string>> {
|
|
let __params = this.newParams();
|
|
let __headers = new HttpHeaders();
|
|
let __body: any = null;
|
|
|
|
let req = new HttpRequest<any>(
|
|
'GET',
|
|
this.rootUrl + `/api/test/${id}`,
|
|
__body,
|
|
{
|
|
headers: __headers,
|
|
params: __params,
|
|
responseType: 'text'
|
|
});
|
|
|
|
return this.http.request<any>(req).pipe(
|
|
__filter(_r => _r instanceof HttpResponse),
|
|
__map((_r) => {
|
|
return _r as __StrictHttpResponse<string>;
|
|
})
|
|
);
|
|
}
|
|
/**
|
|
* @param id undefined
|
|
* @return Success
|
|
*/
|
|
Get_1(id: number): __Observable<string> {
|
|
return this.Get_1Response(id).pipe(
|
|
__map(_r => _r.body as string)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @param params The `ValuesService.PutParams` containing the following parameters:
|
|
*
|
|
* - `id`:
|
|
*
|
|
* - `value`:
|
|
*/
|
|
PutResponse(params: ValuesService.PutParams): __Observable<__StrictHttpResponse<null>> {
|
|
let __params = this.newParams();
|
|
let __headers = new HttpHeaders();
|
|
let __body: any = null;
|
|
|
|
__body = params.value;
|
|
let req = new HttpRequest<any>(
|
|
'PUT',
|
|
this.rootUrl + `/api/test/${params.id}`,
|
|
__body,
|
|
{
|
|
headers: __headers,
|
|
params: __params,
|
|
responseType: 'json'
|
|
});
|
|
|
|
return this.http.request<any>(req).pipe(
|
|
__filter(_r => _r instanceof HttpResponse),
|
|
__map((_r) => {
|
|
return _r as __StrictHttpResponse<null>;
|
|
})
|
|
);
|
|
}
|
|
/**
|
|
* @param params The `ValuesService.PutParams` containing the following parameters:
|
|
*
|
|
* - `id`:
|
|
*
|
|
* - `value`:
|
|
*/
|
|
Put(params: ValuesService.PutParams): __Observable<null> {
|
|
return this.PutResponse(params).pipe(
|
|
__map(_r => _r.body as null)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @param id undefined
|
|
*/
|
|
DeleteResponse(id: number): __Observable<__StrictHttpResponse<null>> {
|
|
let __params = this.newParams();
|
|
let __headers = new HttpHeaders();
|
|
let __body: any = null;
|
|
|
|
let req = new HttpRequest<any>(
|
|
'DELETE',
|
|
this.rootUrl + `/api/test/${id}`,
|
|
__body,
|
|
{
|
|
headers: __headers,
|
|
params: __params,
|
|
responseType: 'json'
|
|
});
|
|
|
|
return this.http.request<any>(req).pipe(
|
|
__filter(_r => _r instanceof HttpResponse),
|
|
__map((_r) => {
|
|
return _r as __StrictHttpResponse<null>;
|
|
})
|
|
);
|
|
}
|
|
/**
|
|
* @param id undefined
|
|
*/
|
|
Delete(id: number): __Observable<null> {
|
|
return this.DeleteResponse(id).pipe(
|
|
__map(_r => _r.body as null)
|
|
);
|
|
}
|
|
}
|
|
|
|
module ValuesService {
|
|
|
|
/**
|
|
* Parameters for Put
|
|
*/
|
|
export interface PutParams {
|
|
id: number;
|
|
value?: string;
|
|
}
|
|
}
|
|
|
|
export { ValuesService }
|