/* tslint:disable */ /* eslint-disable */ /** * TwitchGameApi * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 1.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { CoinDropModel } from '../models'; import { CreatePickupModel } from '../models'; import { CreateRewardModel } from '../models'; import { PickupModel } from '../models'; import { RewardModel } from '../models'; import { UserSummaryModel } from '../models'; /** * RewardsApi - axios parameter creator * @export */ export const RewardsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {CreateRewardModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsGiftPost: async (body?: CreateRewardModel, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/Rewards/Gift`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsOpenIdPost: async (id: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling rewardsOpenIdPost.'); } const localVarPath = `/Rewards/Open/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {CoinDropModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsPickupsCoinDropPost: async (body?: CoinDropModel, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/Rewards/Pickups/CoinDrop`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {CreatePickupModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsPickupsPost: async (body?: CreatePickupModel, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/Rewards/Pickups`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {string} twitchLogin * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsSummaryTwitchLoginGet: async (twitchLogin: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'twitchLogin' is not null or undefined if (twitchLogin === null || twitchLogin === undefined) { throw new RequiredError('twitchLogin','Required parameter twitchLogin was null or undefined when calling rewardsSummaryTwitchLoginGet.'); } const localVarPath = `/Rewards/Summary/{twitchLogin}` .replace(`{${"twitchLogin"}}`, encodeURIComponent(String(twitchLogin))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsUserIdGet: async (id: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling rewardsUserIdGet.'); } const localVarPath = `/Rewards/User/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {number} pickupId * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsUserPickupPickupIdPost: async (pickupId: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'pickupId' is not null or undefined if (pickupId === null || pickupId === undefined) { throw new RequiredError('pickupId','Required parameter pickupId was null or undefined when calling rewardsUserPickupPickupIdPost.'); } const localVarPath = `/Rewards/User/Pickup/{pickupId}` .replace(`{${"pickupId"}}`, encodeURIComponent(String(pickupId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ rewardsUserPickupsGet: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/Rewards/User/Pickups`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * RewardsApi - functional programming interface * @export */ export const RewardsApiFp = function(configuration?: Configuration) { return { /** * * @param {CreateRewardModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsGiftPost(body?: CreateRewardModel, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsGiftPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsOpenIdPost(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsOpenIdPost(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {CoinDropModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsPickupsCoinDropPost(body?: CoinDropModel, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsPickupsCoinDropPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {CreatePickupModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsPickupsPost(body?: CreatePickupModel, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsPickupsPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {string} twitchLogin * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsSummaryTwitchLoginGet(twitchLogin: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsSummaryTwitchLoginGet(twitchLogin, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsUserIdGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsUserIdGet(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {number} pickupId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsUserPickupPickupIdPost(pickupId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsUserPickupPickupIdPost(pickupId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsUserPickupsGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>>> { const localVarAxiosArgs = await RewardsApiAxiosParamCreator(configuration).rewardsUserPickupsGet(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * RewardsApi - factory interface * @export */ export const RewardsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @param {CreateRewardModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsGiftPost(body?: CreateRewardModel, options?: AxiosRequestConfig): Promise> { return RewardsApiFp(configuration).rewardsGiftPost(body, options).then((request) => request(axios, basePath)); }, /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsOpenIdPost(id: number, options?: AxiosRequestConfig): Promise> { return RewardsApiFp(configuration).rewardsOpenIdPost(id, options).then((request) => request(axios, basePath)); }, /** * * @param {CoinDropModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsPickupsCoinDropPost(body?: CoinDropModel, options?: AxiosRequestConfig): Promise> { return RewardsApiFp(configuration).rewardsPickupsCoinDropPost(body, options).then((request) => request(axios, basePath)); }, /** * * @param {CreatePickupModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsPickupsPost(body?: CreatePickupModel, options?: AxiosRequestConfig): Promise> { return RewardsApiFp(configuration).rewardsPickupsPost(body, options).then((request) => request(axios, basePath)); }, /** * * @param {string} twitchLogin * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsSummaryTwitchLoginGet(twitchLogin: string, options?: AxiosRequestConfig): Promise> { return RewardsApiFp(configuration).rewardsSummaryTwitchLoginGet(twitchLogin, options).then((request) => request(axios, basePath)); }, /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsUserIdGet(id: number, options?: AxiosRequestConfig): Promise>> { return RewardsApiFp(configuration).rewardsUserIdGet(id, options).then((request) => request(axios, basePath)); }, /** * * @param {number} pickupId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsUserPickupPickupIdPost(pickupId: number, options?: AxiosRequestConfig): Promise> { return RewardsApiFp(configuration).rewardsUserPickupPickupIdPost(pickupId, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rewardsUserPickupsGet(options?: AxiosRequestConfig): Promise>> { return RewardsApiFp(configuration).rewardsUserPickupsGet(options).then((request) => request(axios, basePath)); }, }; }; /** * RewardsApi - object-oriented interface * @export * @class RewardsApi * @extends {BaseAPI} */ export class RewardsApi extends BaseAPI { /** * * @param {CreateRewardModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsGiftPost(body?: CreateRewardModel, options?: AxiosRequestConfig) : Promise> { return RewardsApiFp(this.configuration).rewardsGiftPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsOpenIdPost(id: number, options?: AxiosRequestConfig) : Promise> { return RewardsApiFp(this.configuration).rewardsOpenIdPost(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {CoinDropModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsPickupsCoinDropPost(body?: CoinDropModel, options?: AxiosRequestConfig) : Promise> { return RewardsApiFp(this.configuration).rewardsPickupsCoinDropPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {CreatePickupModel} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsPickupsPost(body?: CreatePickupModel, options?: AxiosRequestConfig) : Promise> { return RewardsApiFp(this.configuration).rewardsPickupsPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} twitchLogin * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsSummaryTwitchLoginGet(twitchLogin: string, options?: AxiosRequestConfig) : Promise> { return RewardsApiFp(this.configuration).rewardsSummaryTwitchLoginGet(twitchLogin, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsUserIdGet(id: number, options?: AxiosRequestConfig) : Promise>> { return RewardsApiFp(this.configuration).rewardsUserIdGet(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} pickupId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsUserPickupPickupIdPost(pickupId: number, options?: AxiosRequestConfig) : Promise> { return RewardsApiFp(this.configuration).rewardsUserPickupPickupIdPost(pickupId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RewardsApi */ public async rewardsUserPickupsGet(options?: AxiosRequestConfig) : Promise>> { return RewardsApiFp(this.configuration).rewardsUserPickupsGet(options).then((request) => request(this.axios, this.basePath)); } }