UNPKG

@fnt-eve/esi-client-typescript

Version:

[![npm version](https://img.shields.io/npm/v/@fnt-eve/esi-client-typescript)](https://www.npmjs.com/package/@fnt-eve/esi-client-typescript)

314 lines (313 loc) 16.4 kB
/* tslint:disable */ /* eslint-disable */ /** * EVE Swagger Interface * An OpenAPI for EVE Online * * The version of the OpenAPI document: 1.36 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { GetCharactersCharacterIdWalletJournal200OkFromJSON, GetCharactersCharacterIdWalletTransactions200OkFromJSON, GetCorporationsCorporationIdWallets200OkFromJSON, GetCorporationsCorporationIdWalletsDivisionJournal200OkFromJSON, GetCorporationsCorporationIdWalletsDivisionTransactions200OkFromJSON, } from '../models/index'; /** * */ export class WalletApi extends runtime.BaseAPI { /** * Returns a character\'s wallet balance --- This route is cached for up to 120 seconds --- [Diff of the upcoming changes](https://esi.evetech.net/diff/latest/dev/#GET-/characters/{character_id}/wallet/) * Get a character\'s wallet balance */ async getCharactersCharacterIdWalletRaw(requestParameters, initOverrides) { if (requestParameters['characterId'] == null) { throw new runtime.RequiredError('characterId', 'Required parameter "characterId" was null or undefined when calling getCharactersCharacterIdWallet().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['token'] != null) { queryParameters['token'] = requestParameters['token']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("evesso", ["esi-wallet.read_character_wallet.v1"]); } const response = await this.request({ path: `/v1/characters/{character_id}/wallet/`.replace(`{${"character_id"}}`, encodeURIComponent(String(requestParameters['characterId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } } /** * Returns a character\'s wallet balance --- This route is cached for up to 120 seconds --- [Diff of the upcoming changes](https://esi.evetech.net/diff/latest/dev/#GET-/characters/{character_id}/wallet/) * Get a character\'s wallet balance */ async getCharactersCharacterIdWallet(requestParameters, initOverrides) { const response = await this.getCharactersCharacterIdWalletRaw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve the given character\'s wallet journal going 30 days back --- This route is cached for up to 3600 seconds * Get character wallet journal */ async getCharactersCharacterIdWalletJournalRaw(requestParameters, initOverrides) { if (requestParameters['characterId'] == null) { throw new runtime.RequiredError('characterId', 'Required parameter "characterId" was null or undefined when calling getCharactersCharacterIdWalletJournal().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } if (requestParameters['token'] != null) { queryParameters['token'] = requestParameters['token']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("evesso", ["esi-wallet.read_character_wallet.v1"]); } const response = await this.request({ path: `/v5/characters/{character_id}/wallet/journal/`.replace(`{${"character_id"}}`, encodeURIComponent(String(requestParameters['characterId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCharactersCharacterIdWalletJournal200OkFromJSON)); } /** * Retrieve the given character\'s wallet journal going 30 days back --- This route is cached for up to 3600 seconds * Get character wallet journal */ async getCharactersCharacterIdWalletJournal(requestParameters, initOverrides) { const response = await this.getCharactersCharacterIdWalletJournalRaw(requestParameters, initOverrides); return await response.value(); } /** * Get wallet transactions of a character --- This route is cached for up to 3600 seconds * Get wallet transactions */ async getCharactersCharacterIdWalletTransactionsRaw(requestParameters, initOverrides) { if (requestParameters['characterId'] == null) { throw new runtime.RequiredError('characterId', 'Required parameter "characterId" was null or undefined when calling getCharactersCharacterIdWalletTransactions().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['fromId'] != null) { queryParameters['from_id'] = requestParameters['fromId']; } if (requestParameters['token'] != null) { queryParameters['token'] = requestParameters['token']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("evesso", ["esi-wallet.read_character_wallet.v1"]); } const response = await this.request({ path: `/v1/characters/{character_id}/wallet/transactions/`.replace(`{${"character_id"}}`, encodeURIComponent(String(requestParameters['characterId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCharactersCharacterIdWalletTransactions200OkFromJSON)); } /** * Get wallet transactions of a character --- This route is cached for up to 3600 seconds * Get wallet transactions */ async getCharactersCharacterIdWalletTransactions(requestParameters, initOverrides) { const response = await this.getCharactersCharacterIdWalletTransactionsRaw(requestParameters, initOverrides); return await response.value(); } /** * Get a corporation\'s wallets --- This route is cached for up to 300 seconds --- Requires one of the following EVE corporation role(s): Accountant, Junior_Accountant * Returns a corporation\'s wallet balance */ async getCorporationsCorporationIdWalletsRaw(requestParameters, initOverrides) { if (requestParameters['corporationId'] == null) { throw new runtime.RequiredError('corporationId', 'Required parameter "corporationId" was null or undefined when calling getCorporationsCorporationIdWallets().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['token'] != null) { queryParameters['token'] = requestParameters['token']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("evesso", ["esi-wallet.read_corporation_wallets.v1"]); } const response = await this.request({ path: `/v1/corporations/{corporation_id}/wallets/`.replace(`{${"corporation_id"}}`, encodeURIComponent(String(requestParameters['corporationId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCorporationsCorporationIdWallets200OkFromJSON)); } /** * Get a corporation\'s wallets --- This route is cached for up to 300 seconds --- Requires one of the following EVE corporation role(s): Accountant, Junior_Accountant * Returns a corporation\'s wallet balance */ async getCorporationsCorporationIdWallets(requestParameters, initOverrides) { const response = await this.getCorporationsCorporationIdWalletsRaw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve the given corporation\'s wallet journal for the given division going 30 days back --- This route is cached for up to 3600 seconds --- Requires one of the following EVE corporation role(s): Accountant, Junior_Accountant * Get corporation wallet journal */ async getCorporationsCorporationIdWalletsDivisionJournalRaw(requestParameters, initOverrides) { if (requestParameters['corporationId'] == null) { throw new runtime.RequiredError('corporationId', 'Required parameter "corporationId" was null or undefined when calling getCorporationsCorporationIdWalletsDivisionJournal().'); } if (requestParameters['division'] == null) { throw new runtime.RequiredError('division', 'Required parameter "division" was null or undefined when calling getCorporationsCorporationIdWalletsDivisionJournal().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } if (requestParameters['token'] != null) { queryParameters['token'] = requestParameters['token']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("evesso", ["esi-wallet.read_corporation_wallets.v1"]); } const response = await this.request({ path: `/v3/corporations/{corporation_id}/wallets/{division}/journal/`.replace(`{${"corporation_id"}}`, encodeURIComponent(String(requestParameters['corporationId']))).replace(`{${"division"}}`, encodeURIComponent(String(requestParameters['division']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCorporationsCorporationIdWalletsDivisionJournal200OkFromJSON)); } /** * Retrieve the given corporation\'s wallet journal for the given division going 30 days back --- This route is cached for up to 3600 seconds --- Requires one of the following EVE corporation role(s): Accountant, Junior_Accountant * Get corporation wallet journal */ async getCorporationsCorporationIdWalletsDivisionJournal(requestParameters, initOverrides) { const response = await this.getCorporationsCorporationIdWalletsDivisionJournalRaw(requestParameters, initOverrides); return await response.value(); } /** * Get wallet transactions of a corporation --- This route is cached for up to 3600 seconds --- Requires one of the following EVE corporation role(s): Accountant, Junior_Accountant * Get corporation wallet transactions */ async getCorporationsCorporationIdWalletsDivisionTransactionsRaw(requestParameters, initOverrides) { if (requestParameters['corporationId'] == null) { throw new runtime.RequiredError('corporationId', 'Required parameter "corporationId" was null or undefined when calling getCorporationsCorporationIdWalletsDivisionTransactions().'); } if (requestParameters['division'] == null) { throw new runtime.RequiredError('division', 'Required parameter "division" was null or undefined when calling getCorporationsCorporationIdWalletsDivisionTransactions().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['fromId'] != null) { queryParameters['from_id'] = requestParameters['fromId']; } if (requestParameters['token'] != null) { queryParameters['token'] = requestParameters['token']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("evesso", ["esi-wallet.read_corporation_wallets.v1"]); } const response = await this.request({ path: `/v1/corporations/{corporation_id}/wallets/{division}/transactions/`.replace(`{${"corporation_id"}}`, encodeURIComponent(String(requestParameters['corporationId']))).replace(`{${"division"}}`, encodeURIComponent(String(requestParameters['division']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCorporationsCorporationIdWalletsDivisionTransactions200OkFromJSON)); } /** * Get wallet transactions of a corporation --- This route is cached for up to 3600 seconds --- Requires one of the following EVE corporation role(s): Accountant, Junior_Accountant * Get corporation wallet transactions */ async getCorporationsCorporationIdWalletsDivisionTransactions(requestParameters, initOverrides) { const response = await this.getCorporationsCorporationIdWalletsDivisionTransactionsRaw(requestParameters, initOverrides); return await response.value(); } } /** * @export */ export const GetCharactersCharacterIdWalletDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCharactersCharacterIdWalletJournalDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCharactersCharacterIdWalletTransactionsDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCorporationsCorporationIdWalletsDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCorporationsCorporationIdWalletsDivisionJournalDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCorporationsCorporationIdWalletsDivisionTransactionsDatasourceEnum = { Tranquility: 'tranquility' };