/** * Sleeper API * The Sleeper API is a read-only HTTP API that is free to use and allows access to a users leagues, drafts, and rosters. No API Token is necessary, as you cannot modify contents via this API. Be mindful of the frequency of calls. A general rule is to stay under 1000 API calls per minute, otherwise, you risk being IP-blocked. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /* tslint:disable:no-unused-variable member-ordering */ import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; import { AxiosResponse } from 'axios'; import { Observable } from 'rxjs'; import { User } from '../model/user'; import { Configuration } from '../configuration'; @Injectable() export class UserService { protected basePath = 'https://api.sleeper.app/v1'; public defaultHeaders = new Map() public configuration = new Configuration(); constructor(protected httpClient: HttpService, @Optional() configuration: Configuration) { this.configuration = configuration || this.configuration; this.basePath = configuration?.basePath || this.basePath; } /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise */ private canConsumeForm(consumes: string[]): boolean { const form = 'multipart/form-data'; return consumes.includes(form); } /** * Update an existing pet * * @param userId The id of the user to get * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public userUserIdGet(userId: string, ): Observable>; public userUserIdGet(userId: string, ): Observable { if (userId === null || userId === undefined) { throw new Error('Required parameter userId was null or undefined when calling userUserIdGet.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } // to determine the Content-Type header const consumes: string[] = [ ]; return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(userId))}`, { withCredentials: this.configuration.withCredentials, headers: headers } ); } /** * Get user information * * @param username The username to get * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public userUsernameGet(username: string, ): Observable>; public userUsernameGet(username: string, ): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling userUsernameGet.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } // to determine the Content-Type header const consumes: string[] = [ ]; return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, { withCredentials: this.configuration.withCredentials, headers: headers } ); } }