|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * GameServer api |
| 5 | + * Matches, players, mmrs |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 1.0 |
| 8 | + * |
| 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 | + |
| 16 | +import * as runtime from "../runtime"; |
| 17 | + |
| 18 | +import { |
| 19 | + GameserverPlayerRecordsResponse, |
| 20 | + GameserverPlayerRecordsResponseFromJSON, |
| 21 | +} from "../models"; |
| 22 | + |
| 23 | +export interface RecordControllerPlayerRecordRequest { |
| 24 | + steamId: string; |
| 25 | +} |
| 26 | + |
| 27 | +/** |
| 28 | + * |
| 29 | + */ |
| 30 | +export class RecordApi extends runtime.BaseAPI { |
| 31 | + |
| 32 | + /** |
| 33 | + */ |
| 34 | + recordControllerPlayerRecordContext(requestParameters: RecordControllerPlayerRecordRequest): runtime.RequestOpts { |
| 35 | + const queryParameters: any = {}; |
| 36 | + |
| 37 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 38 | + |
| 39 | + return { |
| 40 | + path: `/record/{steam_id}`.replace(`{${"steam_id"}}`, encodeURIComponent(String(requestParameters.steamId))), |
| 41 | + method: 'GET', |
| 42 | + headers: headerParameters, |
| 43 | + query: queryParameters, |
| 44 | + }; |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + */ |
| 49 | + recordControllerPlayerRecord = async (steamId: string): Promise<GameserverPlayerRecordsResponse> => { |
| 50 | + const response = await this.recordControllerPlayerRecordRaw({ steamId: steamId }); |
| 51 | + return await response.value(); |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + */ |
| 56 | + recordControllerRecordsContext(): runtime.RequestOpts { |
| 57 | + const queryParameters: any = {}; |
| 58 | + |
| 59 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 60 | + |
| 61 | + return { |
| 62 | + path: `/record`, |
| 63 | + method: 'GET', |
| 64 | + headers: headerParameters, |
| 65 | + query: queryParameters, |
| 66 | + }; |
| 67 | + } |
| 68 | + |
| 69 | + /** |
| 70 | + */ |
| 71 | + recordControllerRecords = async (): Promise<GameserverPlayerRecordsResponse> => { |
| 72 | + const response = await this.recordControllerRecordsRaw(); |
| 73 | + return await response.value(); |
| 74 | + } |
| 75 | + |
| 76 | + /** |
| 77 | + */ |
| 78 | + private async recordControllerPlayerRecordRaw(requestParameters: RecordControllerPlayerRecordRequest): Promise<runtime.ApiResponse<GameserverPlayerRecordsResponse>> { |
| 79 | + this.recordControllerPlayerRecordValidation(requestParameters); |
| 80 | + const context = this.recordControllerPlayerRecordContext(requestParameters); |
| 81 | + const response = await this.request(context); |
| 82 | + |
| 83 | + return new runtime.JSONApiResponse(response, (jsonValue) => GameserverPlayerRecordsResponseFromJSON(jsonValue)); |
| 84 | + } |
| 85 | + |
| 86 | + /** |
| 87 | + */ |
| 88 | + private recordControllerPlayerRecordValidation(requestParameters: RecordControllerPlayerRecordRequest) { |
| 89 | + if (requestParameters.steamId === null || requestParameters.steamId === undefined) { |
| 90 | + throw new runtime.RequiredError('steamId','Required parameter requestParameters.steamId was null or undefined when calling recordControllerPlayerRecord.'); |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + /** |
| 95 | + */ |
| 96 | + private async recordControllerRecordsRaw(): Promise<runtime.ApiResponse<GameserverPlayerRecordsResponse>> { |
| 97 | + this.recordControllerRecordsValidation(); |
| 98 | + const context = this.recordControllerRecordsContext(); |
| 99 | + const response = await this.request(context); |
| 100 | + |
| 101 | + return new runtime.JSONApiResponse(response, (jsonValue) => GameserverPlayerRecordsResponseFromJSON(jsonValue)); |
| 102 | + } |
| 103 | + |
| 104 | + /** |
| 105 | + */ |
| 106 | + private recordControllerRecordsValidation() { |
| 107 | + } |
| 108 | + |
| 109 | +} |
0 commit comments