/** * This file is auto-generated by the API client generator. * https://github.com/flowup/api-client-generator * * Avoid editing this file manually unless necessary. * Please report any bugs so they can be addressed in future versions. */ /* tslint:disable */ /* eslint-disable */ import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'; import { APIClientInterface } from './api-client.interface'; import { Observable } from 'rxjs';import { DefaultHttpOptions, HttpOptions } from './types'; import * as models from './models'; export const USE_DOMAIN = new InjectionToken('APIClient_USE_DOMAIN'); export const USE_HTTP_OPTIONS = new InjectionToken('APIClient_USE_HTTP_OPTIONS'); type APIHttpOptions = HttpOptions & { headers: HttpHeaders; params: HttpParams; }; @Injectable() export class APIClient implements APIClientInterface { readonly options: APIHttpOptions; readonly domain: string = `//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ''}`; constructor( private readonly http: HttpClient, @Optional() @Inject(USE_DOMAIN) domain?: string, @Optional() @Inject(USE_HTTP_OPTIONS) options?: DefaultHttpOptions, ) { if (domain != null) { this.domain = domain; } this.options = { headers: new HttpHeaders(options && options.headers ? options.headers : {}), params: new HttpParams(options && options.params ? options.params : {}), ...(options && options.reportProgress ? { reportProgress: options.reportProgress } : {}), ...(options && options.withCredentials ? { withCredentials: options.withCredentials } : {}) }; } /** * Get items list * Response generated for [ 200 ] HTTP response code. */ getItems( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getItems( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getItems( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getItems( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/items`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('pageSize' in args) { options.params = options.params.set('pageSize', String(args.pageSize)); } if ('page' in args) { options.params = options.params.set('page', String(args.page)); } return this.http.get(`${this.domain}${path}`, options); } /** * Get item models list * Response generated for [ 200 ] HTTP response code. */ getItemModels( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getItemModels( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getItemModels( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getItemModels( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/itemModels`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('pageSize' in args) { options.params = options.params.set('pageSize', String(args.pageSize)); } if ('page' in args) { options.params = options.params.set('page', String(args.page)); } return this.http.get(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getPetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getPetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getPetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getPetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/pets/${args.id}`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ deletePetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; deletePetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; deletePetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; deletePetsId( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/pets/${args.id}`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.delete(`${this.domain}${path}`, options); } /** * Get details of the game. * Default id param should be overridden to string * Response generated for [ 200 ] HTTP response code. */ getPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/pets-with-default-id-param/${args.id}`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get(`${this.domain}${path}`, options); } /** * Default id param should be number and not string * Response generated for [ 200 ] HTTP response code. */ patchPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; patchPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; patchPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; patchPetsWithDefaultIdParamId( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/pets-with-default-id-param/${args.id}`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.patch(`${this.domain}${path}`, JSON.stringify(args.body), options); } /** * Response generated for [ 200 ] HTTP response code. */ getCustomers( requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable<(models.Customer[]) | null>; getCustomers( requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getCustomers( requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getCustomers( requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable<(models.Customer[]) | null | HttpResponse<(models.Customer[]) | null> | HttpEvent<(models.Customer[]) | null>> { const path = `/customers`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get<(models.Customer[]) | null>(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getDictionaries( requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getDictionaries( requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getDictionaries( requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getDictionaries( requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/dictionaries`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getFileId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getFileId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getFileId( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getFileId( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/file/${args.id}`; const options = { ...this.options, ...requestHttpOptions, observe, responseType: 'blob' as 'json', }; return this.http.get(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getRandomObject( requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getRandomObject( requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getRandomObject( requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getRandomObject( requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/randomObject`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getRandomModel( requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getRandomModel( requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getRandomModel( requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getRandomModel( requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/randomModel`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getRandomString( requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getRandomString( requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getRandomString( requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getRandomString( requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/randomString`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getDictionary( requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable<{ [key: string]: number }>; getDictionary( requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getDictionary( requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getDictionary( requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable<{ [key: string]: number } | HttpResponse<{ [key: string]: number }> | HttpEvent<{ [key: string]: number }>> { const path = `/store/dictionary`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get<{ [key: string]: number }>(`${this.domain}${path}`, options); } /** * Response generated for [ 200 ] HTTP response code. */ getArrayOfDictionaries( requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable<{ [key: string]: number }[]>; getArrayOfDictionaries( requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getArrayOfDictionaries( requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getArrayOfDictionaries( requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable<{ [key: string]: number }[] | HttpResponse<{ [key: string]: number }[]> | HttpEvent<{ [key: string]: number }[]>> { const path = `/store/arrayOfdictionaries`; const options = { ...this.options, ...requestHttpOptions, observe, }; return this.http.get<{ [key: string]: number }[]>(`${this.domain}${path}`, options); } /** * Commits a transaction, while optionally updating documents. * Response generated for [ 200 ] HTTP response code. */ firestoreProjectsDatabasesDocumentsCommit( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; firestoreProjectsDatabasesDocumentsCommit( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; firestoreProjectsDatabasesDocumentsCommit( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; firestoreProjectsDatabasesDocumentsCommit( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/${args.database}/write`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('wololo' in args) { options.params = options.params.set('wololo', String(args.wololo)); } if ('alt' in args) { options.params = options.params.set('alt', String(args.alt)); } if ('accessToken' in args) { options.params = options.params.set('access_token', String(args.accessToken)); } if ('pp' in args) { options.params = options.params.set('pp', String(args.pp)); } if ('prettyPrint' in args) { options.params = options.params.set('prettyPrint', String(args.prettyPrint)); } if ('simpleQueryParam' in args) { options.params = options.params.set('simpleQueryParam', String(args.simpleQueryParam)); } if ('simpleArrayQueryParam' in args) { options.params = options.params.set('simpleArrayQueryParam', String(args.simpleArrayQueryParam)); } return this.http.post(`${this.domain}${path}`, JSON.stringify(args.body), options); } /** * Create a custom Blob. * Response generated for [ 201 ] HTTP response code. */ postReposOwnerRepoGitBlobs( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; postReposOwnerRepoGitBlobs( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; postReposOwnerRepoGitBlobs( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; postReposOwnerRepoGitBlobs( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/repos/${args.owner}/${args.repo}/git/blobs`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } return this.http.post(`${this.domain}${path}`, JSON.stringify(args.body), options); } /** * Get standard File * Response generated for [ 200 ] HTTP response code. */ getReposOwnerRepoGitBlobsShaCode( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getReposOwnerRepoGitBlobsShaCode( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getReposOwnerRepoGitBlobsShaCode( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getReposOwnerRepoGitBlobsShaCode( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/repos/${args.owner}/${args.repo}/git/blobs/${args.shaCode}`; const options = { ...this.options, ...requestHttpOptions, observe, responseType: 'blob' as 'json', }; if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } return this.http.get(`${this.domain}${path}`, options); } }