/* @ts-nocheck */ /* eslint-disable */ /* @noformat */ /* @formatter:off */ /** * Generated by ng-openapi * Generated Angular service for SessionController 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, User, Session } from "../models"; @Injectable({ providedIn: "root" }) export class SessionControllerService { 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'); } addMusic(musicId: string, observe?: 'body', options?: RequestOptions<'json'>): Observable; addMusic(musicId: string, observe?: 'response', options?: RequestOptions<'json'>): Observable>; addMusic(musicId: string, observe?: 'events', options?: RequestOptions<'json'>): Observable>; addMusic(musicId: string, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/session/music/add/${musicId}`; let headers: HttpHeaders; if (options?.headers instanceof HttpHeaders) { headers = options.headers; } else { headers = new HttpHeaders(options?.headers); } // Advertise the response content type declared in the spec if (!headers.has('Accept')) { headers = headers.set('Accept', 'application/json'); } return this.httpClient.request('post', url, { body: null, observe, headers, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }); } getSession(observe?: 'body', options?: RequestOptions<'json'>): Observable; getSession(observe?: 'response', options?: RequestOptions<'json'>): Observable>; getSession(observe?: 'events', options?: RequestOptions<'json'>): Observable>; getSession(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/session`; let headers: HttpHeaders; if (options?.headers instanceof HttpHeaders) { headers = options.headers; } else { headers = new HttpHeaders(options?.headers); } // Advertise the response content type declared in the spec if (!headers.has('Accept')) { headers = headers.set('Accept', 'application/json'); } return this.httpClient.request('get', url, { observe, headers, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }); } playNext(observe?: 'body', options?: RequestOptions<'json'>): Observable; playNext(observe?: 'response', options?: RequestOptions<'json'>): Observable>; playNext(observe?: 'events', options?: RequestOptions<'json'>): Observable>; playNext(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/session/testing/play/next`; let headers: HttpHeaders; if (options?.headers instanceof HttpHeaders) { headers = options.headers; } else { headers = new HttpHeaders(options?.headers); } // Advertise the response content type declared in the spec if (!headers.has('Accept')) { headers = headers.set('Accept', 'application/json'); } return this.httpClient.request('get', url, { observe, headers, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }); } nextUser(observe?: 'body', options?: RequestOptions<'json'>): Observable; nextUser(observe?: 'response', options?: RequestOptions<'json'>): Observable>; nextUser(observe?: 'events', options?: RequestOptions<'json'>): Observable>; nextUser(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable { const url = `${this.basePath}/session/testing/next/user`; let headers: HttpHeaders; if (options?.headers instanceof HttpHeaders) { headers = options.headers; } else { headers = new HttpHeaders(options?.headers); } // Advertise the response content type declared in the spec if (!headers.has('Accept')) { headers = headers.set('Accept', 'application/json'); } return this.httpClient.request('get', url, { observe, headers, reportProgress: options?.reportProgress, withCredentials: options?.withCredentials, context: this.createContextWithClientId(options?.context) }); } }