UNPKG

golemio-sdk

Version:
899 lines (882 loc) 117 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GolemioPublicTransportApi = void 0; /* tslint:disable */ /* eslint-disable */ /** * 🚋 Public Transport | Golemio API * <p><img src=\"https://storage.golemio.cz/golemiocz/images/golemioapi_logos.png\" alt=\"Logos\" /></p> <p><b>Toto je část dokumentace REST API projektu pražské datové platformy Golemio, která obsahuje popis Public Transport Output Gateway API.</b></p> <p>Veškeré dotazy prosím směřujte na <a href=\"mailto:golemio@operatorict.cz?subject=golemioapi\">golemio@operatorict.cz</a>.</p> <p>Dokumentace je v anglickém jazyce. Více informací o projektu naleznete na <a href=\"https://www.golemio.cz/\">www.golemio.cz</a>.</p> <H1>Description</H1> <p><b>This documentation covers the RESTful API of the Golemio Prague Data Platform project, specifically detailing the Public Transport Output Gateway API.</b></p> <p>Support is accessible via <a href=\"mailto:golemio@operatorict.cz?subject=golemioapi\">golemio@operatorict.cz</a>.</p> <p>For more information about Golemio, please visit the website <a href=\"https://www.golemio.cz/\">www.golemio.cz</a>.</p> <H2>Golemio API documentation:</H2> <li><a href=\"https://api.golemio.cz/docs/openapi/\">Main Golemio API</a></li> <li><a href=\"https://api.golemio.cz/docs/public-openapi/\">Open Data Golemio API</a></li> <li><a href=\"https://api.golemio.cz/input-gateway/docs/openapi/\">Golemio Input Gateway API</a></li> <li>👉 Public Transport Golemio API</li> <li><a href=\"https://api.golemio.cz/pid/input-gateway/docs/openapi/\">Public Transport Golemio Input Gateway API</a></li> <H1>General info</H1> <H2>Authorization</H2> <p>Generate your token at <a href=\"https://api.golemio.cz/api-keys\">api.golemio.cz/api-keys</a>.</p> <p><b>Use the token as the value of the X-Access-Token header.</b></p> <H1>Usage</H1> <H2>Pagination</H2> <p>The API returns a maximum of 10,000 objects/rows per request. You can specify a lower number by adding the <code>?limit</code> URL parameter.</p> <p> This limit may vary depending on the specific route; please refer to the description of parameters for each route. To retrieve more data, use multiple requests with the <code>?limit&offset</code> parameters. Refer to the examples below. </p> <H2>Requests rate</H2> <p>By default, each API key has a rate limit of 20 requests per 8 seconds.</p> <H2>Compression</H2> <p>By default, the Content-Encoding header is set to gzip (if requested). If the raw response is less than 1 KB, the data is returned uncompressed, and the Content-Encoding header is not set.</p> <H2>General Transit Feed Specification</H2> <p>Access GTFS (<a href=\"https://developers.google.com/transit/gtfs\">General Transit Feed Specification</a>) data on the city\'s public transportation schedules through this API.</p> <p>The data is published by ROPID and remains valid for the upcoming ~12 days, subject to daily updates.</p> <p>Learn more at <a href=\"https://pid.cz/o-systemu/opendata/\">pid.cz</a>.</p> <H2>Open Data</H2> <p><img src=\"https://img.shields.io/badge/opendata-available-green\" alt=\"golemioapi-opendata-badge\" /></p> <p>This badge means it is available for public use as Open Data.</p> * * The version of the OpenAPI document: 1.0.0 * Contact: golemio@operatorict.cz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ const configuration_1 = require("./configuration"); const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("./common"); // @ts-ignore const base_1 = require("./base"); class GolemioPublicTransportApi { constructor(configurationParams, axios) { const configuration = Object.assign({}, configuration_1.defaultConfigurationParameters, configurationParams); if (!axios) axios = axios_1.default.create(); this.FYPRV1Api = new GolemioPublicTransportApi.FYPRV1Api(configuration, axios); this.GTFSRealtimeV2Api = new GolemioPublicTransportApi.GTFSRealtimeV2Api(configuration, axios); this.GTFSStaticV2Api = new GolemioPublicTransportApi.GTFSStaticV2Api(configuration, axios); this.JISV1InternalApi = new GolemioPublicTransportApi.JISV1InternalApi(configuration, axios); this.PIDDepartureBoardsV2Api = new GolemioPublicTransportApi.PIDDepartureBoardsV2Api(configuration, axios); this.PIDDepartureBoardsV3Api = new GolemioPublicTransportApi.PIDDepartureBoardsV3Api(configuration, axios); this.PIDDepartureBoardsV3InternalApi = new GolemioPublicTransportApi.PIDDepartureBoardsV3InternalApi(configuration, axios); this.PIDDepartureBoardsV4Api = new GolemioPublicTransportApi.PIDDepartureBoardsV4Api(configuration, axios); this.PIDRealtimePositionsV2Api = new GolemioPublicTransportApi.PIDRealtimePositionsV2Api(configuration, axios); this.PublicDeparturesV2Api = new GolemioPublicTransportApi.PublicDeparturesV2Api(configuration, axios); this.PublicGTFSStaticLookupV2Api = new GolemioPublicTransportApi.PublicGTFSStaticLookupV2Api(configuration, axios); this.PublicVehiclePositionsV2Api = new GolemioPublicTransportApi.PublicVehiclePositionsV2Api(configuration, axios); } ; } exports.GolemioPublicTransportApi = GolemioPublicTransportApi; (function (GolemioPublicTransportApi) { GolemioPublicTransportApi.DisplayCaseKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.DisplayCaseBaseKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.ElementBaseKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.EventCustomFormatTypeEnum = { Incident: 'INCIDENT', Disruption: 'DISRUPTION', ServiceChange: 'SERVICE_CHANGE' }; GolemioPublicTransportApi.EventCustomFormatSeverityLevelEnum = { Info: 'INFO', Warning: 'WARNING', Severe: 'SEVERE' }; GolemioPublicTransportApi.GeometryPointTypeEnum = { Point: 'Point' }; GolemioPublicTransportApi.InformationPanelKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.InformationPanelBaseKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.ObeliskKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.ObeliskBaseKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.PIDDepartureBoardInfotextDisplayTypeEnum = { Inline: 'inline', General: 'general' }; GolemioPublicTransportApi.PIDDepartureBoardInfotextsInnerDisplayTypeEnum = { Inline: 'inline', General: 'general' }; GolemioPublicTransportApi.PublicDepartureRouteTypeEnum = { Tram: 'tram', Metro: 'metro', Train: 'train', Bus: 'bus', Ferry: 'ferry', Funicular: 'funicular', Trolleybus: 'trolleybus', ExtMiscellaneous: 'ext_miscellaneous' }; /** * 0 - tram \\ 1 - metro \\ 2 - rail \\ 3 - bus \\ 4 - ferry \\ 7 - funicular \\ 11 - trolleybus * @export * @enum {number} */ GolemioPublicTransportApi.RouteType = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3, NUMBER_4: 4, NUMBER_7: 7, NUMBER_11: 11 }; GolemioPublicTransportApi.ScopeInfoRouteTypeEnum = { Tram: 'tram', Metro: 'metro', Train: 'train', Bus: 'bus', Ferry: 'ferry', Funicular: 'funicular', Trolleybus: 'trolleybus', ExtMiscellaneous: 'ext_miscellaneous' }; GolemioPublicTransportApi.ScopeStaticInfoRouteTypeEnum = { Tram: 'tram', Metro: 'metro', Train: 'train', Bus: 'bus', Ferry: 'ferry', Funicular: 'funicular', Trolleybus: 'trolleybus', ExtMiscellaneous: 'ext_miscellaneous' }; GolemioPublicTransportApi.SignpostKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.SignpostBaseKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; /** * - `at_stop` - The position is tracking and the closest anchor point or metro rail track segment is a stop. - `before_track` - The position is not tracking and either the trip\'s previous position is not known, or the previous position\'s state is `at_stop` or `on_track`. - `before_track_delayed` - The position has a delay prediction based on the vehicle\'s previous trip. - `canceled` - The position is canceled. - `off_track` - The position is tracking and the vehicle is 200+ meters from the closest anchor point or metro rail track segment of its track. For metro positions, it is additionally required that the vehicle\'s message attributes `tm` and `odch` or less than or equal to the arrival to the final stop. - `on_track` - The position is tracking, but is neither `at_stop` nor `off_track`. The following states also exist internally but are excluded from the API output: - `after_track` - The position is not tracking and the trip\'s last known position is tracking. For metro positions, this can also mean that it is tracking, the vehicle is 200+ meters from the closest metro rail track segment of its track and the vehicle\'s message attributes `tm` and `odch` or higher than the arrival to the final stop. For other positions from TCP sources (DPP buses and trams), this can also mean that it is tracking and the vehicle sent a message while at the final stop or sent a message with the `tjr` attribute higher than the arrival to the final stop. - `after_track_delayed` - The same as `after_track`, but the position always has defined delay (not null) if possible to deduct from GTFS static data and origin timestamp. Essentially, it means the vehicle is `at_stop` at the very last stop of the trip. The delay is also propagated to the next trip of the vehicle, unlike the `after_track` state. - `duplicate` - The position is not tracking, the trip\'s last known position is tracking and there is another position with identical `origin_timestamp`. - `invisible` - The position is not tracking and either: - the trip\'s previous position is not known or the previous position\'s state is `at_stop` or `on_track`, and the vehicle is on its way from the garage; - or the trip\'s last known position is tracking and the vehicle is on its way to the garage. - `mismatched` - The position does not make sense (e.g. it was sent late and thus has a mismatched stop sequence). - `not_public` - The position belongs to a non-public trip (trip without run schedule). - `unknown` - The position is not yet processed (or was determined to never be processed) or has been invalidated (e.g. due to a vehicle repeating some part of the trip). * @export * @enum {string} */ GolemioPublicTransportApi.StatePosition = { AtStop: 'at_stop', BeforeTrack: 'before_track', BeforeTrackDelayed: 'before_track_delayed', Canceled: 'canceled', OffTrack: 'off_track', OnTrack: 'on_track' }; GolemioPublicTransportApi.TotemKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.TotemBaseKindEnum = { Totem: 'totem', InformationPanel: 'information_panel', DisplayCase: 'display_case', Obelisk: 'obelisk', Signpost: 'signpost' }; GolemioPublicTransportApi.TransferboardsDepartureIconsEnum = { Metro: 'metro', Tram: 'tram', Bus: 'bus', Trolleybus: 'trolleybus', Train: 'train', Funicular: 'funicular', Aerial: 'aerial', Ferry: 'ferry', Airport: 'airport', AirportBus: 'airport_bus', AirportTrolleybus: 'airport_trolleybus', AirportTrain: 'airport_train', A: 'a', B: 'b', C: 'c', D: 'd', SBahn: 's_bahn', Space: 'space' }; GolemioPublicTransportApi.V2PublicGtfsTripsGtfsTripIdGet200ResponseRouteTypeEnum = { Tram: 'tram', Metro: 'metro', Train: 'train', Bus: 'bus', Ferry: 'ferry', Funicular: 'funicular', Trolleybus: 'trolleybus', ExtMiscellaneous: 'ext_miscellaneous' }; GolemioPublicTransportApi.V2PublicVehiclepositionsVehicleIdGet200ResponseRouteTypeEnum = { Tram: 'tram', Metro: 'metro', Train: 'train', Bus: 'bus', Ferry: 'ferry', Funicular: 'funicular', Trolleybus: 'trolleybus', ExtMiscellaneous: 'ext_miscellaneous' }; GolemioPublicTransportApi.V3PidInfotextsGet200ResponseInnerDisplayTypeEnum = { Inline: 'inline', General: 'general' }; GolemioPublicTransportApi.V3PidInfotextsGet200ResponseInnerPriorityEnum = { Low: 'low', Normal: 'normal', High: 'high' }; GolemioPublicTransportApi.V3PidTransferboardsGet200ResponseInfotextsInnerDisplayTypeEnum = { Inline: 'inline', General: 'general' }; GolemioPublicTransportApi.V4PidTransferboardsGet200ResponseIconsEnum = { Metro: 'metro', Tram: 'tram', Bus: 'bus', Trolleybus: 'trolleybus', Train: 'train', Funicular: 'funicular', Aerial: 'aerial', Ferry: 'ferry', Airport: 'airport', AirportBus: 'airport_bus', AirportTrolleybus: 'airport_trolleybus', AirportTrain: 'airport_train', A: 'a', B: 'b', C: 'c', D: 'd', SBahn: 's_bahn', Space: 'space' }; GolemioPublicTransportApi.V4PidTransferboardsGet200ResponseInfotextsInnerDisplayTypeEnum = { Inline: 'inline', General: 'general' }; GolemioPublicTransportApi.VehiclePositionsFeatureGeometryTypeEnum = { Point: 'Point', Polygon: 'Polygon', MultiPolygon: 'MultiPolygon' }; /** * @export */ GolemioPublicTransportApi.GetFyprElementDetailKindEnum = { DisplayCases: 'display-cases', InformationPanels: 'information-panels', Obelisks: 'obelisks', Signposts: 'signposts', Totems: 'totems' }; /** * FYPRV1Api - object-oriented interface * @export * @class FYPRV1Api * @extends {BaseAPI} */ class FYPRV1Api extends base_1.BaseAPI { constructor(configuration, axios = axios_1.default) { super(configuration, configuration.basePath, axios); this.configuration = configuration; this.axios = axios; } /** * * @summary GET FYPR element by kind and id * @param {KindEnum} kind Kind of the FYPR element. * @param {string} id UUID of the element to retrieve. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ getFyprElementDetail(kind_1, id_1) { return __awaiter(this, arguments, void 0, function* (kind, id, options = {}) { // verify required parameter 'kind' is not null or undefined (0, common_1.assertParamExists)('getFyprElementDetail', 'kind', kind); (0, common_1.assertParamExists)('getFyprElementDetail', 'id', id); // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getFyprElementDetail', 'kind', kind); (0, common_1.assertParamExists)('getFyprElementDetail', 'id', id); const localVarPath = `/v1/fypr/elements/{kind}/{id}` .replace(`{${"kind"}}`, encodeURIComponent(String(kind))) .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET FYPR metadata and field translations per kind * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ getFyprMetadata() { return __awaiter(this, arguments, void 0, function* (options = {}) { const localVarPath = `/v1/fypr/metadata`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET Display Cases * @param {FYPRV1ApiListDisplayCasesQueryParams} queryParams Query parameters. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ listDisplayCases() { return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) { const localVarPath = `/v1/fypr/elements/display-cases`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); if (queryParams.limit !== undefined) { requestQueryParameter['limit'] = queryParams.limit; } if (queryParams.offset !== undefined) { requestQueryParameter['offset'] = queryParams.offset; } (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET FYPR links to elements kinds * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ listFyprElementsKinds() { return __awaiter(this, arguments, void 0, function* (options = {}) { const localVarPath = `/v1/fypr/elements`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET Information Panels * @param {FYPRV1ApiListInformationPanelsQueryParams} queryParams Query parameters. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ listInformationPanels() { return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) { const localVarPath = `/v1/fypr/elements/information-panels`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); if (queryParams.limit !== undefined) { requestQueryParameter['limit'] = queryParams.limit; } if (queryParams.offset !== undefined) { requestQueryParameter['offset'] = queryParams.offset; } (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET Obelisks * @param {FYPRV1ApiListObelisksQueryParams} queryParams Query parameters. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ listObelisks() { return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) { const localVarPath = `/v1/fypr/elements/obelisks`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); if (queryParams.limit !== undefined) { requestQueryParameter['limit'] = queryParams.limit; } if (queryParams.offset !== undefined) { requestQueryParameter['offset'] = queryParams.offset; } (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET Signposts * @param {FYPRV1ApiListSignpostsQueryParams} queryParams Query parameters. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ listSignposts() { return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) { const localVarPath = `/v1/fypr/elements/signposts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); if (queryParams.limit !== undefined) { requestQueryParameter['limit'] = queryParams.limit; } if (queryParams.offset !== undefined) { requestQueryParameter['offset'] = queryParams.offset; } (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET Totems * @param {FYPRV1ApiListTotemsQueryParams} queryParams Query parameters. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof FYPRV1Api */ listTotems() { return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) { const localVarPath = `/v1/fypr/elements/totems`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); if (queryParams.limit !== undefined) { requestQueryParameter['limit'] = queryParams.limit; } if (queryParams.offset !== undefined) { requestQueryParameter['offset'] = queryParams.offset; } (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } } GolemioPublicTransportApi.FYPRV1Api = FYPRV1Api; /** * GTFSRealtimeV2Api - object-oriented interface * @export * @class GTFSRealtimeV2Api * @extends {BaseAPI} */ class GTFSRealtimeV2Api extends base_1.BaseAPI { constructor(configuration, axios = axios_1.default) { super(configuration, configuration.basePath, axios); this.configuration = configuration; this.axios = axios; } /** * * @summary GET GTFS-RT Service Alerts Feed * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSRealtimeV2Api */ v2VehiclepositionsGtfsrtAlertsPbGet() { return __awaiter(this, arguments, void 0, function* (options = {}) { const localVarPath = `/v2/vehiclepositions/gtfsrt/alerts.pb`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET GTFS-RT PID Feed (trip updates and vehicle positions, combined) * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSRealtimeV2Api */ v2VehiclepositionsGtfsrtPidFeedPbGet() { return __awaiter(this, arguments, void 0, function* (options = {}) { const localVarPath = `/v2/vehiclepositions/gtfsrt/pid_feed.pb`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET GTFS-RT Trip Updates Feed * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSRealtimeV2Api */ v2VehiclepositionsGtfsrtTripUpdatesPbGet() { return __awaiter(this, arguments, void 0, function* (options = {}) { const localVarPath = `/v2/vehiclepositions/gtfsrt/trip_updates.pb`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET GTFS-RT Vehicle Positions Feed * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSRealtimeV2Api */ v2VehiclepositionsGtfsrtVehiclePositionsPbGet() { return __awaiter(this, arguments, void 0, function* (options = {}) { const localVarPath = `/v2/vehiclepositions/gtfsrt/vehicle_positions.pb`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } } GolemioPublicTransportApi.GTFSRealtimeV2Api = GTFSRealtimeV2Api; /** * GTFSStaticV2Api - object-oriented interface * @export * @class GTFSStaticV2Api * @extends {BaseAPI} */ class GTFSStaticV2Api extends base_1.BaseAPI { constructor(configuration, axios = axios_1.default) { super(configuration, configuration.basePath, axios); this.configuration = configuration; this.axios = axios; } /** * * @summary GET All GTFS Routes * @param {GTFSStaticV2ApiV2GtfsRoutesGetQueryParams} queryParams Query parameters. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSStaticV2Api */ v2GtfsRoutesGet() { return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) { const localVarPath = `/v2/gtfs/routes`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); if (queryParams.limit !== undefined) { requestQueryParameter['limit'] = queryParams.limit; } if (queryParams.offset !== undefined) { requestQueryParameter['offset'] = queryParams.offset; } (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET GTFS Route * @param {string} id * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSStaticV2Api */ v2GtfsRoutesIdGet(id_1) { return __awaiter(this, arguments, void 0, function* (id, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('v2GtfsRoutesIdGet', 'id', id); const localVarPath = `/v2/gtfs/routes/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET GTFS Services * @param {GTFSStaticV2ApiV2GtfsServicesGetQueryParams} queryParams Query parameters. * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSStaticV2Api */ v2GtfsServicesGet() { return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) { const localVarPath = `/v2/gtfs/services`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); if (queryParams.date !== undefined) { requestQueryParameter['date'] = queryParams.date; } if (queryParams.limit !== undefined) { requestQueryParameter['limit'] = queryParams.limit; } if (queryParams.offset !== undefined) { requestQueryParameter['offset'] = queryParams.offset; } (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET GTFS Shape * @param {string} id * @param {AxiosRequestConfig} [options] Override http request option. * @throws {RequiredError} * @memberof GTFSStaticV2Api */ v2GtfsShapesIdGet(id_1) { return __awaiter(this, arguments, void 0, function* (id, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('v2GtfsShapesIdGet', 'id', id); const localVarPath = `/v2/gtfs/shapes/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const requestUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (this.configuration) { baseOptions = this.configuration.baseOptions; } const axiosRequestConfig = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const requestHeaderParameter = {}; const requestQueryParameter = {}; // authentication ApiKeyAuth required yield (0, common_1.setApiKeyToObject)(requestHeaderParameter, "X-Access-Token", this.configuration); (0, common_1.setSearchParams)(requestUrlObj, requestQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; axiosRequestConfig.headers = Object.assign(Object.assign(Object.assign({}, requestHeaderParameter), headersFromBaseOptions), options.headers); axiosRequestConfig["url"] = (0, common_1.toPathString)(requestUrlObj); axiosRequestConfig["baseURL"] = this.configuration.basePath; return this.axios.request(axiosRequestConfig); }); } /** * * @summary GET All GTFS Stops * @param {GTFSStaticV2ApiV2GtfsStops