@hasadna/open-bus-api-client
Version:
A client library for interacting with the Open-Bus API.
106 lines (94 loc) • 4.95 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Open Bus Stride API
* ### Follow planned and real-time bus statistics 🚌 Welcome to The Public Knowledge Workshop\'s Stride project. We provide usable and accurate data about the Israeli public transportation system. For background on the project and some more detailed documentation and usage guides, see [STRIDE.md](https://github.com/hasadna/open-bus-pipelines/blob/main/STRIDE.md). Looking for a specific use-case? * Take a look at the **user cases** APIs below. * Try one of our existing [jupyter notebooks](https://github.com/hasadna/open-bus-stride-client/blob/main/README.md#using-the-interactive-jupyter-notebooks). * Don\'t see your use-case covered here? Please [open us a ticket](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhasadna%2Fopen-bus%2Fissues%2Fnew)! Queries are by default limited to 100 results per query, this limit can be increased up to 500,000 results. Please try to set appropriate query parameters to limit the results to reduce load on our DB. If you do need to get large number of results (up to 500,000) it\'s recommended to use one of these methods: 1. Use HTTP streaming and JSON streaming decoder, this method is most efficient and provide accurate results. Our [Stride Python Client iterate method](https://github.com/hasadna/open-bus-stride-client#usage) uses this method. 2. Use combination of limit / offset parameters to get results by page. This method may be less accurate because it depends on data remaining unchanged between requests. For more advanced usage- * Use **gtfs** for data about the planned lines timetables. * Use **siri** for data about lines real-time * See [Open Bus Stride Data Model](https://github.com/hasadna/open-bus-stride-db/blob/main/DATA_MODEL.md) for description of field and table names. * See [Open Bus Stride ETL Processes](https://github.com/hasadna/open-bus-pipelines/blob/main/STRIDE_ETL_PROCESSES.md) for description of the ETL processes which fetch and aggregate the data. * See [MOT Developer Information](https://www.gov.il/BlobFolder/generalpage/gtfs_general_transit_feed_specifications/he/GTFS%20-%20Developer%20Information.pdf) for description of the source fields as published by the Israel Ministry of Transportation.
*
* The version of the OpenAPI document: 6909b3db7b8bfa5ac3f3c4aeb3de80d2a2c75810
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { Get200ResponseGovApi } from './Get200ResponseGovApi';
import {
Get200ResponseGovApiFromJSON,
Get200ResponseGovApiFromJSONTyped,
Get200ResponseGovApiToJSON,
Get200ResponseGovApiToJSONTyped,
} from './Get200ResponseGovApi';
/**
*
* @export
* @interface Get200Response
*/
export interface Get200Response {
/**
*
* @type {string}
* @memberof Get200Response
*/
status?: string;
/**
*
* @type {Get200ResponseGovApi}
* @memberof Get200Response
*/
govApi?: Get200ResponseGovApi;
/**
*
* @type {Date}
* @memberof Get200Response
*/
timestamp?: Date;
/**
*
* @type {number}
* @memberof Get200Response
*/
uptime?: number;
/**
*
* @type {string}
* @memberof Get200Response
*/
version?: string;
}
/**
* Check if a given object implements the Get200Response interface.
*/
export function instanceOfGet200Response(value: object): value is Get200Response {
return true;
}
export function Get200ResponseFromJSON(json: any): Get200Response {
return Get200ResponseFromJSONTyped(json, false);
}
export function Get200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Get200Response {
if (json == null) {
return json;
}
return {
'status': json['status'] == null ? undefined : json['status'],
'govApi': json['gov_api'] == null ? undefined : Get200ResponseGovApiFromJSON(json['gov_api']),
'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
'uptime': json['uptime'] == null ? undefined : json['uptime'],
'version': json['version'] == null ? undefined : json['version'],
};
}
export function Get200ResponseToJSON(json: any): Get200Response {
return Get200ResponseToJSONTyped(json, false);
}
export function Get200ResponseToJSONTyped(value?: Get200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'status': value['status'],
'gov_api': Get200ResponseGovApiToJSON(value['govApi']),
'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
'uptime': value['uptime'],
'version': value['version'],
};
}