/* @ts-nocheck */ /* eslint-disable */ /* @noformat */ /* @formatter:off */ /** * Generated by ng-openapi * Generated Angular service for Bookings 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, CreateBookingDto, UpdateBookingDto } from "../models"; @Injectable({ providedIn: "root" }) export class BookingsService { 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'); } bookingsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable; bookingsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable>; bookingsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable>; bookingsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/bookings`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.get(url, requestOptions); } bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/bookings`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.post(url, createBookingDto, requestOptions); } bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable; bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable>; bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable>; bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/bookings/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); } bookingsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable; bookingsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable>; bookingsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable>; bookingsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/bookings/${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); } bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/bookings/${id}`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.patch(url, updateBookingDto, requestOptions); } bookingsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable; bookingsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable>; bookingsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable>; bookingsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/bookings/${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); } }