/* @ts-nocheck */ /* eslint-disable */ /* @noformat */ /* @formatter:off */ /** * Generated by ng-openapi * Generated Angular service for Calendar 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, CreateEventDto, CreateExceptionDto, CalendarCreateBookingDto, CancelBookingDto, CalenderControllerGetBookingResponse } from "../models"; @Injectable({ providedIn: "root" }) export class CalendarService { 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'); } calendarControllerGetCalendarEvents(observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerGetCalendarEvents(observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerGetCalendarEvents(observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerGetCalendarEvents(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.get(url, requestOptions); } calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/events`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.post(url, createEventDto, requestOptions); } calendarControllerGetEventById(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerGetEventById(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerGetEventById(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerGetEventById(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/events/${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); } calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/events/${id}`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.patch(url, createEventDto, requestOptions); } calendarControllerDeleteEvent(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerDeleteEvent(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerDeleteEvent(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerDeleteEvent(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/events/${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); } calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/events/${id}/exceptions`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.post(url, createExceptionDto, requestOptions); } calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/events/${id}/bookings`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.post(url, calendarCreateBookingDto, requestOptions); } calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/bookings/${bookingId}/cancel`; const requestOptions: any = { observe: observe as any, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }; return this.httpClient.patch(url, cancelBookingDto, requestOptions); } calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body', options?: RequestOptions<'json'>): Observable; calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'response', options?: RequestOptions<'json'>): Observable>; calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'events', options?: RequestOptions<'json'>): Observable>; calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/api/calendar/bookings/${eventId}`; let params = new HttpParams(); if (page != null) { params = HttpParamsBuilder.addToHttpParams(params, page, 'page'); } if (limit != null) { params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit'); } if (sortBy != null) { params = HttpParamsBuilder.addToHttpParams(params, sortBy, 'sortBy'); } if (order != null) { params = HttpParamsBuilder.addToHttpParams(params, order, 'order'); } if (startTime != null) { params = HttpParamsBuilder.addToHttpParams(params, startTime, 'startTime'); } 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); } }