/* 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>> { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; let req = new HttpRequest( 'GET', this.rootUrl + `/api/test`, __body, { headers: __headers, params: __params, responseType: 'json' }); return this.http.request(req).pipe( __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse>; }) ); } /** * @return Success */ Get(): __Observable> { return this.GetResponse().pipe( __map(_r => _r.body as Array) ); } /** * @param value undefined */ PostResponse(value?: string): __Observable<__StrictHttpResponse> { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; __body = value; let req = new HttpRequest( 'POST', this.rootUrl + `/api/test`, __body, { headers: __headers, params: __params, responseType: 'json' }); return this.http.request(req).pipe( __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; }) ); } /** * @param value undefined */ Post(value?: string): __Observable { return this.PostResponse(value).pipe( __map(_r => _r.body as null) ); } /** * @param id undefined * @return Success */ Get_1Response(id: number): __Observable<__StrictHttpResponse> { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; let req = new HttpRequest( 'GET', this.rootUrl + `/api/test/${id}`, __body, { headers: __headers, params: __params, responseType: 'text' }); return this.http.request(req).pipe( __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; }) ); } /** * @param id undefined * @return Success */ Get_1(id: number): __Observable { 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> { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; __body = params.value; let req = new HttpRequest( 'PUT', this.rootUrl + `/api/test/${params.id}`, __body, { headers: __headers, params: __params, responseType: 'json' }); return this.http.request(req).pipe( __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; }) ); } /** * @param params The `ValuesService.PutParams` containing the following parameters: * * - `id`: * * - `value`: */ Put(params: ValuesService.PutParams): __Observable { return this.PutResponse(params).pipe( __map(_r => _r.body as null) ); } /** * @param id undefined */ DeleteResponse(id: number): __Observable<__StrictHttpResponse> { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; let req = new HttpRequest( 'DELETE', this.rootUrl + `/api/test/${id}`, __body, { headers: __headers, params: __params, responseType: 'json' }); return this.http.request(req).pipe( __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; }) ); } /** * @param id undefined */ Delete(id: number): __Observable { 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 }