golemio-sdk
Version:
TypeScript SDK for api.golemio.cz
851 lines (835 loc) • 92.6 kB
JavaScript
"use strict";
/* 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.
*/
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;
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.GTFSRealtimeV2Api = new GolemioPublicTransportApi.GTFSRealtimeV2Api(configuration, axios);
this.GTFSStaticV2Api = new GolemioPublicTransportApi.GTFSStaticV2Api(configuration, axios);
this.JISV1Api = new GolemioPublicTransportApi.JISV1Api(configuration, axios);
this.PIDDepartureBoardsV2Api = new GolemioPublicTransportApi.PIDDepartureBoardsV2Api(configuration, axios);
this.PIDDepartureBoardsV3Api = new GolemioPublicTransportApi.PIDDepartureBoardsV3Api(configuration, axios);
this.PIDDepartureBoardsV3InternalApi = new GolemioPublicTransportApi.PIDDepartureBoardsV3InternalApi(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.EventCustomFormatTypeEnum = {
Incident: 'INCIDENT',
Disruption: 'DISRUPTION',
ServiceChange: 'SERVICE_CHANGE'
};
GolemioPublicTransportApi.EventCustomFormatSeverityLevelEnum = {
Info: 'INFO',
Warning: 'WARNING',
Severe: 'SEVERE'
};
GolemioPublicTransportApi.GeometryPointTypeEnum = {
Point: 'Point'
};
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'
};
/**
* - `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.V2PidInfotextsGet200ResponseInnerDisplayTypeEnum = {
Inline: 'inline',
General: 'general'
};
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.VehiclePositionsFeatureGeometryTypeEnum = {
Point: 'Point',
Polygon: 'Polygon',
MultiPolygon: 'MultiPolygon'
};
/**
* 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 {GTFSStaticV2ApiV2GtfsStopsGetQueryParams} queryParams Query parameters.
* @param {AxiosRequestConfig} [options] Override http request option.
* @throws {RequiredError}
* @memberof GTFSStaticV2Api
*/
v2GtfsStopsGet() {
return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) {
const localVarPath = `/v2/gtfs/stops`;
// 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.names !== undefined) {
requestQueryParameter['names'] = queryParams.names;
}
if (queryParams.ids !== undefined) {
requestQueryParameter['ids'] = queryParams.ids;
}
if (queryParams.aswIds !== undefined) {
requestQueryParameter['aswIds'] = queryParams.aswIds;
}
if (queryParams.cisIds !== undefined) {
requestQueryParameter['cisIds'] = queryParams.cisIds;
}
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 Stop
* @param {string} id
* @param {AxiosRequestConfig} [options] Override http request option.
* @throws {RequiredError}
* @memberof GTFSStaticV2Api
*/
v2GtfsStopsIdGet(id_1) {
return __awaiter(this, arguments, void 0, function* (id, options = {}) {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('v2GtfsStopsIdGet', 'id', id);
const localVarPath = `/v2/gtfs/stops/{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 Stop times
* @param {string} id
* @param {GTFSStaticV2ApiV2GtfsStoptimesIdGetQueryParams} queryParams Query parameters.
* @param {AxiosRequestConfig} [options] Override http request option.
* @throws {RequiredError}
* @memberof GTFSStaticV2Api
*/
v2GtfsStoptimesIdGet(id_1, queryParams_1) {
return __awaiter(this, arguments, void 0, function* (id, queryParams, options = {}) {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('v2GtfsStoptimesIdGet', 'id', id);
const localVarPath = `/v2/gtfs/stoptimes/{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);
if (queryParams.date !== undefined) {
requestQueryParameter['date'] = queryParams.date;
}
if (queryParams.from !== undefined) {
requestQueryParameter['from'] = queryParams.from;
}
if (queryParams.to !== undefined) {
requestQueryParameter['to'] = queryParams.to;
}
if (queryParams.includeStop !== undefined) {
requestQueryParameter['includeStop'] = queryParams.includeStop;
}
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 All GTFS Trips
* @param {GTFSStaticV2ApiV2GtfsTripsGetQueryParams} queryParams Query parameters.
* @param {AxiosRequestConfig} [options] Override http request option.
* @throws {RequiredError}
* @memberof GTFSStaticV2Api
*/
v2GtfsTripsGet() {
return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) {
const localVarPath = `/v2/gtfs/trips`;
// 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.stopId !== undefined) {
requestQueryParameter['stopId'] = queryParams.stopId;
}
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 Trip
* @param {string} id
* @param {GTFSStaticV2ApiV2GtfsTripsIdGetQueryParams} queryParams Query parameters.
* @param {AxiosRequestConfig} [options] Override http request option.
* @throws {RequiredError}
* @memberof GTFSStaticV2Api
*/
v2GtfsTripsIdGet(id_1, queryParams_1) {
return __awaiter(this, arguments, void 0, function* (id, queryParams, options = {}) {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('v2GtfsTripsIdGet', 'id', id);
const localVarPath = `/v2/gtfs/trips/{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);
if (queryParams.includeShapes !== undefined) {
requestQueryParameter['includeShapes'] = queryParams.includeShapes;
}
if (queryParams.includeStops !== undefined) {
requestQueryParameter['includeStops'] = queryParams.includeStops;
}
if (queryParams.includeStopTimes !== undefined) {
requestQueryParameter['includeStopTimes'] = queryParams.includeStopTimes;
}
if (queryParams.includeService !== undefined) {
requestQueryParameter['includeService'] = queryParams.includeService;
}
if (queryParams.includeRoute !== undefined) {
requestQueryParameter['includeRoute'] = queryParams.includeRoute;
}
if (queryParams.date !== undefined) {
requestQueryParameter['date'] = queryParams.date;
}
(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.GTFSStaticV2Api = GTFSStaticV2Api;
/**
* JISV1Api - object-oriented interface
* @export
* @class JISV1Api
* @extends {BaseAPI}
*/
class JISV1Api extends base_1.BaseAPI {
constructor(configuration, axios = axios_1.default) {
super(configuration, configuration.basePath, axios);
this.configuration = configuration;
this.axios = axios;
}
/**
*
* @summary Get all published events in custom format for external use
* @param {JISV1ApiV1JisEventsCustomFormatGetQueryParams} queryParams Query parameters.
* @param {AxiosRequestConfig} [options] Override http request option.
* @throws {RequiredError}
* @memberof JISV1Api
*/
v1JisEventsCustomFormatGet() {
return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) {
const localVarPath = `/v1/jis/events/custom-format`;
// 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.displayPeriodStart !== undefined) {
requestQueryParameter['displayPeriodStart'] = (queryParams.displayPeriodStart instanceof Date) ?
queryParams.displayPeriodStart.toISOString() :
queryParams.displayPeriodStart;
}
if (queryParams.displayPeriodEnd !== undefined) {
requestQueryParameter['displayPeriodEnd'] = (queryParams.displayPeriodEnd instanceof Date) ?
queryParams.displayPeriodEnd.toISOString() :
queryParams.displayPeriodEnd;
}
if (queryParams.organizationNames) {
requestQueryParameter['organizationNames'] = queryParams.organizationNames;
}
(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.JISV1Api = JISV1Api;
/**
* @export
*/
GolemioPublicTransportApi.V2PidDepartureboardsGetSkipEnum = {
Canceled: 'canceled',
AtStop: 'atStop',
Untracked: 'untracked',
Missing: 'missing'
};
/**
* PIDDepartureBoardsV2Api - object-oriented interface
* @export
* @class PIDDepartureBoardsV2Api
* @extends {BaseAPI}
*/
class PIDDepartureBoardsV2Api extends base_1.BaseAPI {
constructor(configuration, axios = axios_1.default) {
super(configuration, configuration.basePath, axios);
this.configuration = configuration;
this.axios = axios;
}
/**
* You have to use query parameters `ids`, `cisIds`, `aswIds` or `names` in array format - eg. `ids[]=1&ids[]=3`. **At least one of these IDs is required.** The maximum is 100 stops combined in one request.
* @summary GET Departure Boards
* @param {PIDDepartureBoardsV2ApiV2PidDepartureboardsGetQueryParams} queryParams Query parameters.
* @param {AxiosRequestConfig} [options] Override http request option.
* @throws {RequiredError}
* @memberof PIDDepartureBoardsV2Api
*/
v2PidDepartureboardsGet() {
return __awaiter(this, arguments, void 0, function* (queryParams = {}, options = {}) {
const localVarPath = `/v2/pid/departureboards`;
// 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.ids !== undefined) {
requestQueryParameter['ids'] = queryParams.ids;
}
if (queryParams.aswIds !== undefined) {
requestQueryParameter['aswIds'] = queryParams.aswIds;
}
if (queryParams.cisIds !== undefined) {
requestQueryParameter['cisIds'] = queryParams.cisIds;
}
if (queryParams.names !== undefined) {
requestQueryParameter['names'] = queryParams.names;
}
if (queryParams.minutesBefore !== undefined) {
requestQueryParameter['minutesBefore'] = queryParams.minutesBefore;
}
if (queryParams.minutesAfter !== undefined) {
requestQueryParameter['minutesAfter'] = queryParams.minutesAfter;
}
if (queryParams.timeFrom !== undefined) {
requestQueryParameter['timeFrom'] = queryParams.timeFrom;
}
if (queryParams.includeMetroTrains !== undefined) {
requestQueryParameter['includeMetroTrains'] = queryParams.includeMetroTrains;
}
if (queryParams.airCondition !== undefined) {
requestQueryParameter['airCondition'] = queryParams.airCondition;
}
if (queryParams.preferredTimezone !== undefined) {
requestQueryParameter['preferredTimezone'] = queryParams.preferredTimezone;
}
if (queryParams.mode !== undefined) {
requestQueryParameter['mode'] = queryParams.mode;
}
if (queryParams.order !== undefined) {
requestQueryParameter['order'] = queryParams.order;
}
if (queryParams.filter !== undefined) {
requestQueryParameter['filter'] = queryParams.filter;
}
if (queryParams.skip !== undefined) {
requestQueryParameter['skip'] = queryParams.skip;
}
if (queryParams.limit !== undefined) {
requestQueryParameter['limit'] = queryParams.limit;
}
if (queryParams.total !== undefined) {
requestQueryParameter['total'] = queryParams.total;
}