560 lines
18 KiB
TypeScript
560 lines
18 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* FastAPI
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
*
|
|
* The version of the OpenAPI document: 0.1.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
import type { Configuration } from './configuration';
|
|
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
import globalAxios from 'axios';
|
|
// Some imports not used depending on template conditions
|
|
// @ts-ignore
|
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
import type { RequestArgs } from './base';
|
|
// @ts-ignore
|
|
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface AllStationResponse
|
|
*/
|
|
export interface AllStationResponse {
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof AllStationResponse
|
|
*/
|
|
'stations': any;
|
|
}
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface HTTPValidationError
|
|
*/
|
|
export interface HTTPValidationError {
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof HTTPValidationError
|
|
*/
|
|
'detail'?: any;
|
|
}
|
|
/**
|
|
* An enumeration.
|
|
* @export
|
|
* @interface Route
|
|
*/
|
|
export interface Route {
|
|
}
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface RouteResponse
|
|
*/
|
|
export interface RouteResponse {
|
|
/**
|
|
*
|
|
* @type {Route}
|
|
* @memberof RouteResponse
|
|
*/
|
|
'routeId': Route;
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof RouteResponse
|
|
*/
|
|
'arrival_times': any;
|
|
}
|
|
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface StationResponse
|
|
*/
|
|
export interface StationResponse {
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof StationResponse
|
|
*/
|
|
'stationId': any;
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof StationResponse
|
|
*/
|
|
'routes': any;
|
|
}
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface ValidationError
|
|
*/
|
|
export interface ValidationError {
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof ValidationError
|
|
*/
|
|
'loc': any;
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof ValidationError
|
|
*/
|
|
'msg': any;
|
|
/**
|
|
*
|
|
* @type {any}
|
|
* @memberof ValidationError
|
|
*/
|
|
'type': any;
|
|
}
|
|
|
|
/**
|
|
* ConfigApi - axios parameter creator
|
|
* @export
|
|
*/
|
|
export const ConfigApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getAllApiConfigGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
const localVarPath = `/api/config`;
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* ConfigApi - functional programming interface
|
|
* @export
|
|
*/
|
|
export const ConfigApiFp = function(configuration?: Configuration) {
|
|
const localVarAxiosParamCreator = ConfigApiAxiosParamCreator(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async getAllApiConfigGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllApiConfigGet(options);
|
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* ConfigApi - factory interface
|
|
* @export
|
|
*/
|
|
export const ConfigApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
const localVarFp = ConfigApiFp(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getAllApiConfigGet(options?: any): AxiosPromise<any> {
|
|
return localVarFp.getAllApiConfigGet(options).then((request) => request(axios, basePath));
|
|
},
|
|
};
|
|
};
|
|
|
|
/**
|
|
* ConfigApi - object-oriented interface
|
|
* @export
|
|
* @class ConfigApi
|
|
* @extends {BaseAPI}
|
|
*/
|
|
export class ConfigApi extends BaseAPI {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof ConfigApi
|
|
*/
|
|
public getAllApiConfigGet(options?: AxiosRequestConfig) {
|
|
return ConfigApiFp(this.configuration).getAllApiConfigGet(options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* MtaDataApi - axios parameter creator
|
|
* @export
|
|
*/
|
|
export const MtaDataApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getAllApiMtaPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
const localVarPath = `/api/mta`;
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
/**
|
|
*
|
|
* @summary Get Route
|
|
* @param {any} stopId
|
|
* @param {Route} route
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getRouteApiMtaStopIdRoutePost: async (stopId: any, route: Route, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'stopId' is not null or undefined
|
|
assertParamExists('getRouteApiMtaStopIdRoutePost', 'stopId', stopId)
|
|
// verify required parameter 'route' is not null or undefined
|
|
assertParamExists('getRouteApiMtaStopIdRoutePost', 'route', route)
|
|
const localVarPath = `/api/mta/{stop_id}/{route}`
|
|
.replace(`{${"stop_id"}}`, encodeURIComponent(String(stopId)))
|
|
.replace(`{${"route"}}`, encodeURIComponent(String(route)));
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
/**
|
|
*
|
|
* @summary Get Station
|
|
* @param {any} stopId
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getStationApiMtaStopIdPost: async (stopId: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'stopId' is not null or undefined
|
|
assertParamExists('getStationApiMtaStopIdPost', 'stopId', stopId)
|
|
const localVarPath = `/api/mta/{stop_id}`
|
|
.replace(`{${"stop_id"}}`, encodeURIComponent(String(stopId)));
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* MtaDataApi - functional programming interface
|
|
* @export
|
|
*/
|
|
export const MtaDataApiFp = function(configuration?: Configuration) {
|
|
const localVarAxiosParamCreator = MtaDataApiAxiosParamCreator(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async getAllApiMtaPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AllStationResponse>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllApiMtaPost(options);
|
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
},
|
|
/**
|
|
*
|
|
* @summary Get Route
|
|
* @param {any} stopId
|
|
* @param {Route} route
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async getRouteApiMtaStopIdRoutePost(stopId: any, route: Route, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RouteResponse>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getRouteApiMtaStopIdRoutePost(stopId, route, options);
|
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
},
|
|
/**
|
|
*
|
|
* @summary Get Station
|
|
* @param {any} stopId
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async getStationApiMtaStopIdPost(stopId: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StationResponse>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getStationApiMtaStopIdPost(stopId, options);
|
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* MtaDataApi - factory interface
|
|
* @export
|
|
*/
|
|
export const MtaDataApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
const localVarFp = MtaDataApiFp(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getAllApiMtaPost(options?: any): AxiosPromise<AllStationResponse> {
|
|
return localVarFp.getAllApiMtaPost(options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
*
|
|
* @summary Get Route
|
|
* @param {any} stopId
|
|
* @param {Route} route
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getRouteApiMtaStopIdRoutePost(stopId: any, route: Route, options?: any): AxiosPromise<RouteResponse> {
|
|
return localVarFp.getRouteApiMtaStopIdRoutePost(stopId, route, options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
*
|
|
* @summary Get Station
|
|
* @param {any} stopId
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getStationApiMtaStopIdPost(stopId: any, options?: any): AxiosPromise<StationResponse> {
|
|
return localVarFp.getStationApiMtaStopIdPost(stopId, options).then((request) => request(axios, basePath));
|
|
},
|
|
};
|
|
};
|
|
|
|
/**
|
|
* MtaDataApi - object-oriented interface
|
|
* @export
|
|
* @class MtaDataApi
|
|
* @extends {BaseAPI}
|
|
*/
|
|
export class MtaDataApi extends BaseAPI {
|
|
/**
|
|
*
|
|
* @summary Get All
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof MtaDataApi
|
|
*/
|
|
public getAllApiMtaPost(options?: AxiosRequestConfig) {
|
|
return MtaDataApiFp(this.configuration).getAllApiMtaPost(options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @summary Get Route
|
|
* @param {any} stopId
|
|
* @param {Route} route
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof MtaDataApi
|
|
*/
|
|
public getRouteApiMtaStopIdRoutePost(stopId: any, route: Route, options?: AxiosRequestConfig) {
|
|
return MtaDataApiFp(this.configuration).getRouteApiMtaStopIdRoutePost(stopId, route, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @summary Get Station
|
|
* @param {any} stopId
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof MtaDataApi
|
|
*/
|
|
public getStationApiMtaStopIdPost(stopId: any, options?: AxiosRequestConfig) {
|
|
return MtaDataApiFp(this.configuration).getStationApiMtaStopIdPost(stopId, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* StartApi - axios parameter creator
|
|
* @export
|
|
*/
|
|
export const StartApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get Start Time
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getStartTimeApiStartTimePost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
const localVarPath = `/api/start_time`;
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* StartApi - functional programming interface
|
|
* @export
|
|
*/
|
|
export const StartApiFp = function(configuration?: Configuration) {
|
|
const localVarAxiosParamCreator = StartApiAxiosParamCreator(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get Start Time
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async getStartTimeApiStartTimePost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getStartTimeApiStartTimePost(options);
|
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* StartApi - factory interface
|
|
* @export
|
|
*/
|
|
export const StartApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
const localVarFp = StartApiFp(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary Get Start Time
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getStartTimeApiStartTimePost(options?: any): AxiosPromise<any> {
|
|
return localVarFp.getStartTimeApiStartTimePost(options).then((request) => request(axios, basePath));
|
|
},
|
|
};
|
|
};
|
|
|
|
/**
|
|
* StartApi - object-oriented interface
|
|
* @export
|
|
* @class StartApi
|
|
* @extends {BaseAPI}
|
|
*/
|
|
export class StartApi extends BaseAPI {
|
|
/**
|
|
*
|
|
* @summary Get Start Time
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof StartApi
|
|
*/
|
|
public getStartTimeApiStartTimePost(options?: AxiosRequestConfig) {
|
|
return StartApiFp(this.configuration).getStartTimeApiStartTimePost(options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
}
|
|
|
|
|