|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * CodeCharacter API |
| 5 | + * Specification of the CodeCharacter API |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 2023.0.1 |
| 8 | + * Contact: delta@nitt.edu |
| 9 | + * |
| 10 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 11 | + * https://openapi-generator.tech |
| 12 | + * Do not edit the class manually. |
| 13 | + */ |
| 14 | + |
| 15 | +import * as runtime from '../runtime'; |
| 16 | +import type { UserMatchStats } from '../models'; |
| 17 | + |
| 18 | +/** |
| 19 | + * StatsApi - interface |
| 20 | + * |
| 21 | + * @export |
| 22 | + * @interface StatsApiInterface |
| 23 | + */ |
| 24 | +export interface StatsApiInterface { |
| 25 | + /** |
| 26 | + * Gets all statistics for the current user |
| 27 | + * @summary Get all General Stats for current user and top user |
| 28 | + * @param {*} [options] Override http request option. |
| 29 | + * @throws {RequiredError} |
| 30 | + * @memberof StatsApiInterface |
| 31 | + */ |
| 32 | + getStatsRaw( |
| 33 | + initOverrides?: RequestInit | runtime.InitOverrideFunction, |
| 34 | + ): Promise<runtime.ApiResponse<Array<UserMatchStats>>>; |
| 35 | + |
| 36 | + /** |
| 37 | + * Gets all statistics for the current user |
| 38 | + * Get all General Stats for current user and top user |
| 39 | + */ |
| 40 | + getStats( |
| 41 | + initOverrides?: RequestInit | runtime.InitOverrideFunction, |
| 42 | + ): Promise<Array<UserMatchStats>>; |
| 43 | +} |
| 44 | + |
| 45 | +/** |
| 46 | + * |
| 47 | + */ |
| 48 | +export class StatsApi extends runtime.BaseAPI implements StatsApiInterface { |
| 49 | + /** |
| 50 | + * Gets all statistics for the current user |
| 51 | + * Get all General Stats for current user and top user |
| 52 | + */ |
| 53 | + async getStatsRaw( |
| 54 | + initOverrides?: RequestInit | runtime.InitOverrideFunction, |
| 55 | + ): Promise<runtime.ApiResponse<Array<UserMatchStats>>> { |
| 56 | + const queryParameters: any = {}; |
| 57 | + |
| 58 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 59 | + |
| 60 | + if (this.configuration && this.configuration.accessToken) { |
| 61 | + const token = this.configuration.accessToken; |
| 62 | + const tokenString = await token('http-bearer', []); |
| 63 | + |
| 64 | + if (tokenString) { |
| 65 | + headerParameters['Authorization'] = `Bearer ${tokenString}`; |
| 66 | + } |
| 67 | + } |
| 68 | + const response = await this.request( |
| 69 | + { |
| 70 | + path: `/stats/`, |
| 71 | + method: 'GET', |
| 72 | + headers: headerParameters, |
| 73 | + query: queryParameters, |
| 74 | + }, |
| 75 | + initOverrides, |
| 76 | + ); |
| 77 | + |
| 78 | + return new runtime.JSONApiResponse(response); |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Gets all statistics for the current user |
| 83 | + * Get all General Stats for current user and top user |
| 84 | + */ |
| 85 | + async getStats( |
| 86 | + initOverrides?: RequestInit | runtime.InitOverrideFunction, |
| 87 | + ): Promise<Array<UserMatchStats>> { |
| 88 | + const response = await this.getStatsRaw(initOverrides); |
| 89 | + return await response.value(); |
| 90 | + } |
| 91 | +} |
0 commit comments