/* @ts-nocheck */ /* eslint-disable */ /* @noformat */ /* @formatter:off */ /** * Generated by ng-openapi * Generated Angular service for User controller * Do not edit this file manually */ import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http"; import { inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens"; import { HttpParamsBuilder } from "../utils/http-params-builder"; import { RequestOptions, CreateUserDto, UpdateUserDto } from "../models"; @Injectable({ providedIn: "root" }) export class UserService { private readonly httpClient: HttpClient = inject(HttpClient); private readonly basePath: string = inject(BASE_PATH_DEFAULT); private readonly clientContextToken: HttpContextToken = CLIENT_CONTEXT_TOKEN_DEFAULT; private createContextWithClientId(existingContext?: HttpContext): HttpContext { const context = existingContext || new HttpContext(); return context.set(this.clientContextToken, 'default'); } userControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable; userControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable>; userControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable>; userControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/user`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.get(url, requestOptions); } userControllerCreate(createUserDto: CreateUserDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; userControllerCreate(createUserDto: CreateUserDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; userControllerCreate(createUserDto: CreateUserDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; userControllerCreate(createUserDto: CreateUserDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/user`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.post(url, createUserDto, requestOptions); } userControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable; userControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable>; userControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable>; userControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/user/search`; let params = new HttpParams(); if (q != null) { params = HttpParamsBuilder.addToHttpParams(params, q, 'q'); } if (page != null) { params = HttpParamsBuilder.addToHttpParams(params, page, 'page'); } if (limit != null) { params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit'); } const requestOptions: any = { observe: observe as any, params, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.get(url, requestOptions); } userControllerFindOne(id: string, observe?: 'body', options?: RequestOptions<'json'>): Observable; userControllerFindOne(id: string, observe?: 'response', options?: RequestOptions<'json'>): Observable>; userControllerFindOne(id: string, observe?: 'events', options?: RequestOptions<'json'>): Observable>; userControllerFindOne(id: string, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/user/${id}`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.get(url, requestOptions); } userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/user/${id}`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.patch(url, updateUserDto, requestOptions); } userControllerRemove(id: string, observe?: 'body', options?: RequestOptions<'json'>): Observable; userControllerRemove(id: string, observe?: 'response', options?: RequestOptions<'json'>): Observable>; userControllerRemove(id: string, observe?: 'events', options?: RequestOptions<'json'>): Observable>; userControllerRemove(id: string, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/user/${id}`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.delete(url, requestOptions); } }