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)

449 lines (448 loc) 22.9 kB
/* tslint:disable */ /* eslint-disable */ /** * EVE Swagger Interface * An OpenAPI for EVE Online * * The version of the OpenAPI document: 1.33 * * * 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 { GetCharactersCharacterIdContracts200OkFromJSON, GetCharactersCharacterIdContractsContractIdBids200OkFromJSON, GetCharactersCharacterIdContractsContractIdItems200OkFromJSON, GetContractsPublicBidsContractId200OkFromJSON, GetContractsPublicItemsContractId200OkFromJSON, GetContractsPublicRegionId200OkFromJSON, GetCorporationsCorporationIdContracts200OkFromJSON, GetCorporationsCorporationIdContractsContractIdBids200OkFromJSON, GetCorporationsCorporationIdContractsContractIdItems200OkFromJSON, } from '../models/index'; /** * */ export class ContractsApi extends runtime.BaseAPI { /** * Returns contracts available to a character, only if the character is issuer, acceptor or assignee. Only returns contracts no older than 30 days, or if the status is \"in_progress\". --- This route is cached for up to 300 seconds * Get contracts */ async getCharactersCharacterIdContractsRaw(requestParameters, initOverrides) { if (requestParameters['characterId'] == null) { throw new runtime.RequiredError('characterId', 'Required parameter "characterId" was null or undefined when calling getCharactersCharacterIdContracts().'); } 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-contracts.read_character_contracts.v1"]); } const response = await this.request({ path: `/v1/characters/{character_id}/contracts/`.replace(`{${"character_id"}}`, encodeURIComponent(String(requestParameters['characterId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCharactersCharacterIdContracts200OkFromJSON)); } /** * Returns contracts available to a character, only if the character is issuer, acceptor or assignee. Only returns contracts no older than 30 days, or if the status is \"in_progress\". --- This route is cached for up to 300 seconds * Get contracts */ async getCharactersCharacterIdContracts(requestParameters, initOverrides) { const response = await this.getCharactersCharacterIdContractsRaw(requestParameters, initOverrides); return await response.value(); } /** * Lists bids on a particular auction contract --- This route is cached for up to 300 seconds * Get contract bids */ async getCharactersCharacterIdContractsContractIdBidsRaw(requestParameters, initOverrides) { if (requestParameters['characterId'] == null) { throw new runtime.RequiredError('characterId', 'Required parameter "characterId" was null or undefined when calling getCharactersCharacterIdContractsContractIdBids().'); } if (requestParameters['contractId'] == null) { throw new runtime.RequiredError('contractId', 'Required parameter "contractId" was null or undefined when calling getCharactersCharacterIdContractsContractIdBids().'); } 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-contracts.read_character_contracts.v1"]); } const response = await this.request({ path: `/v1/characters/{character_id}/contracts/{contract_id}/bids/`.replace(`{${"character_id"}}`, encodeURIComponent(String(requestParameters['characterId']))).replace(`{${"contract_id"}}`, encodeURIComponent(String(requestParameters['contractId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCharactersCharacterIdContractsContractIdBids200OkFromJSON)); } /** * Lists bids on a particular auction contract --- This route is cached for up to 300 seconds * Get contract bids */ async getCharactersCharacterIdContractsContractIdBids(requestParameters, initOverrides) { const response = await this.getCharactersCharacterIdContractsContractIdBidsRaw(requestParameters, initOverrides); return await response.value(); } /** * Lists items of a particular contract --- This route is cached for up to 3600 seconds * Get contract items */ async getCharactersCharacterIdContractsContractIdItemsRaw(requestParameters, initOverrides) { if (requestParameters['characterId'] == null) { throw new runtime.RequiredError('characterId', 'Required parameter "characterId" was null or undefined when calling getCharactersCharacterIdContractsContractIdItems().'); } if (requestParameters['contractId'] == null) { throw new runtime.RequiredError('contractId', 'Required parameter "contractId" was null or undefined when calling getCharactersCharacterIdContractsContractIdItems().'); } 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-contracts.read_character_contracts.v1"]); } const response = await this.request({ path: `/v1/characters/{character_id}/contracts/{contract_id}/items/`.replace(`{${"character_id"}}`, encodeURIComponent(String(requestParameters['characterId']))).replace(`{${"contract_id"}}`, encodeURIComponent(String(requestParameters['contractId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCharactersCharacterIdContractsContractIdItems200OkFromJSON)); } /** * Lists items of a particular contract --- This route is cached for up to 3600 seconds * Get contract items */ async getCharactersCharacterIdContractsContractIdItems(requestParameters, initOverrides) { const response = await this.getCharactersCharacterIdContractsContractIdItemsRaw(requestParameters, initOverrides); return await response.value(); } /** * Lists bids on a public auction contract --- This route is cached for up to 300 seconds * Get public contract bids */ async getContractsPublicBidsContractIdRaw(requestParameters, initOverrides) { if (requestParameters['contractId'] == null) { throw new runtime.RequiredError('contractId', 'Required parameter "contractId" was null or undefined when calling getContractsPublicBidsContractId().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } const response = await this.request({ path: `/v1/contracts/public/bids/{contract_id}/`.replace(`{${"contract_id"}}`, encodeURIComponent(String(requestParameters['contractId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetContractsPublicBidsContractId200OkFromJSON)); } /** * Lists bids on a public auction contract --- This route is cached for up to 300 seconds * Get public contract bids */ async getContractsPublicBidsContractId(requestParameters, initOverrides) { const response = await this.getContractsPublicBidsContractIdRaw(requestParameters, initOverrides); switch (response.raw.status) { case 200: return await response.value(); case 204: return null; default: return await response.value(); } } /** * Lists items of a public contract --- This route is cached for up to 3600 seconds * Get public contract items */ async getContractsPublicItemsContractIdRaw(requestParameters, initOverrides) { if (requestParameters['contractId'] == null) { throw new runtime.RequiredError('contractId', 'Required parameter "contractId" was null or undefined when calling getContractsPublicItemsContractId().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } const response = await this.request({ path: `/v1/contracts/public/items/{contract_id}/`.replace(`{${"contract_id"}}`, encodeURIComponent(String(requestParameters['contractId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetContractsPublicItemsContractId200OkFromJSON)); } /** * Lists items of a public contract --- This route is cached for up to 3600 seconds * Get public contract items */ async getContractsPublicItemsContractId(requestParameters, initOverrides) { const response = await this.getContractsPublicItemsContractIdRaw(requestParameters, initOverrides); switch (response.raw.status) { case 200: return await response.value(); case 204: return null; default: return await response.value(); } } /** * Returns a paginated list of all public contracts in the given region --- This route is cached for up to 1800 seconds * Get public contracts */ async getContractsPublicRegionIdRaw(requestParameters, initOverrides) { if (requestParameters['regionId'] == null) { throw new runtime.RequiredError('regionId', 'Required parameter "regionId" was null or undefined when calling getContractsPublicRegionId().'); } const queryParameters = {}; if (requestParameters['datasource'] != null) { queryParameters['datasource'] = requestParameters['datasource']; } if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } const headerParameters = {}; if (requestParameters['ifNoneMatch'] != null) { headerParameters['If-None-Match'] = String(requestParameters['ifNoneMatch']); } const response = await this.request({ path: `/v1/contracts/public/{region_id}/`.replace(`{${"region_id"}}`, encodeURIComponent(String(requestParameters['regionId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetContractsPublicRegionId200OkFromJSON)); } /** * Returns a paginated list of all public contracts in the given region --- This route is cached for up to 1800 seconds * Get public contracts */ async getContractsPublicRegionId(requestParameters, initOverrides) { const response = await this.getContractsPublicRegionIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Returns contracts available to a corporation, only if the corporation is issuer, acceptor or assignee. Only returns contracts no older than 30 days, or if the status is \"in_progress\". --- This route is cached for up to 300 seconds * Get corporation contracts */ async getCorporationsCorporationIdContractsRaw(requestParameters, initOverrides) { if (requestParameters['corporationId'] == null) { throw new runtime.RequiredError('corporationId', 'Required parameter "corporationId" was null or undefined when calling getCorporationsCorporationIdContracts().'); } 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-contracts.read_corporation_contracts.v1"]); } const response = await this.request({ path: `/v1/corporations/{corporation_id}/contracts/`.replace(`{${"corporation_id"}}`, encodeURIComponent(String(requestParameters['corporationId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCorporationsCorporationIdContracts200OkFromJSON)); } /** * Returns contracts available to a corporation, only if the corporation is issuer, acceptor or assignee. Only returns contracts no older than 30 days, or if the status is \"in_progress\". --- This route is cached for up to 300 seconds * Get corporation contracts */ async getCorporationsCorporationIdContracts(requestParameters, initOverrides) { const response = await this.getCorporationsCorporationIdContractsRaw(requestParameters, initOverrides); return await response.value(); } /** * Lists bids on a particular auction contract --- This route is cached for up to 3600 seconds * Get corporation contract bids */ async getCorporationsCorporationIdContractsContractIdBidsRaw(requestParameters, initOverrides) { if (requestParameters['contractId'] == null) { throw new runtime.RequiredError('contractId', 'Required parameter "contractId" was null or undefined when calling getCorporationsCorporationIdContractsContractIdBids().'); } if (requestParameters['corporationId'] == null) { throw new runtime.RequiredError('corporationId', 'Required parameter "corporationId" was null or undefined when calling getCorporationsCorporationIdContractsContractIdBids().'); } 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-contracts.read_corporation_contracts.v1"]); } const response = await this.request({ path: `/v1/corporations/{corporation_id}/contracts/{contract_id}/bids/`.replace(`{${"contract_id"}}`, encodeURIComponent(String(requestParameters['contractId']))).replace(`{${"corporation_id"}}`, encodeURIComponent(String(requestParameters['corporationId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCorporationsCorporationIdContractsContractIdBids200OkFromJSON)); } /** * Lists bids on a particular auction contract --- This route is cached for up to 3600 seconds * Get corporation contract bids */ async getCorporationsCorporationIdContractsContractIdBids(requestParameters, initOverrides) { const response = await this.getCorporationsCorporationIdContractsContractIdBidsRaw(requestParameters, initOverrides); return await response.value(); } /** * Lists items of a particular contract --- This route is cached for up to 3600 seconds * Get corporation contract items */ async getCorporationsCorporationIdContractsContractIdItemsRaw(requestParameters, initOverrides) { if (requestParameters['contractId'] == null) { throw new runtime.RequiredError('contractId', 'Required parameter "contractId" was null or undefined when calling getCorporationsCorporationIdContractsContractIdItems().'); } if (requestParameters['corporationId'] == null) { throw new runtime.RequiredError('corporationId', 'Required parameter "corporationId" was null or undefined when calling getCorporationsCorporationIdContractsContractIdItems().'); } 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-contracts.read_corporation_contracts.v1"]); } const response = await this.request({ path: `/v1/corporations/{corporation_id}/contracts/{contract_id}/items/`.replace(`{${"contract_id"}}`, encodeURIComponent(String(requestParameters['contractId']))).replace(`{${"corporation_id"}}`, encodeURIComponent(String(requestParameters['corporationId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCorporationsCorporationIdContractsContractIdItems200OkFromJSON)); } /** * Lists items of a particular contract --- This route is cached for up to 3600 seconds * Get corporation contract items */ async getCorporationsCorporationIdContractsContractIdItems(requestParameters, initOverrides) { const response = await this.getCorporationsCorporationIdContractsContractIdItemsRaw(requestParameters, initOverrides); return await response.value(); } } /** * @export */ export const GetCharactersCharacterIdContractsDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCharactersCharacterIdContractsContractIdBidsDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCharactersCharacterIdContractsContractIdItemsDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetContractsPublicBidsContractIdDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetContractsPublicItemsContractIdDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetContractsPublicRegionIdDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCorporationsCorporationIdContractsDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCorporationsCorporationIdContractsContractIdBidsDatasourceEnum = { Tranquility: 'tranquility' }; /** * @export */ export const GetCorporationsCorporationIdContractsContractIdItemsDatasourceEnum = { Tranquility: 'tranquility' };