motis-openapi-sdk-1.0.0/.cargo_vcs_info.json0000644000000001570000000000100144000ustar { "git": { "sha1": "c48fdd8c4f992622ccf72990d389f6851f67624b" }, "path_in_vcs": "motis-openapi-sdk" }motis-openapi-sdk-1.0.0/.gitignore000064400000000000000000000000371046102023000151550ustar 00000000000000/target/ **/*.rs.bk Cargo.lock motis-openapi-sdk-1.0.0/.openapi-generator/FILES000064400000000000000000000027211046102023000174510ustar 00000000000000.gitignore .travis.yml Cargo.toml README.md docs/Area.md docs/DebugApi.md docs/Direction.md docs/Duration.md docs/EncodedPolyline.md docs/Footpath.md docs/Footpaths200Response.md docs/GeocodeApi.md docs/Initial200Response.md docs/Itinerary.md docs/Leg.md docs/MapApi.md docs/Match.md docs/Mode.md docs/PedestrianProfile.md docs/Place.md docs/Plan200Response.md docs/Rental.md docs/RentalFormFactor.md docs/RentalPropulsionType.md docs/RentalReturnConstraint.md docs/RoutingApi.md docs/StepInstruction.md docs/StopTime.md docs/Stoptimes200Response.md docs/TimetableApi.md docs/TripInfo.md docs/TripSegment.md docs/VertexType.md git_push.sh src/apis/configuration.rs src/apis/debug_api.rs src/apis/geocode_api.rs src/apis/map_api.rs src/apis/mod.rs src/apis/routing_api.rs src/apis/timetable_api.rs src/lib.rs src/models/area.rs src/models/direction.rs src/models/duration.rs src/models/encoded_polyline.rs src/models/footpath.rs src/models/footpaths_200_response.rs src/models/initial_200_response.rs src/models/itinerary.rs src/models/leg.rs src/models/mod.rs src/models/mode.rs src/models/model_match.rs src/models/pedestrian_profile.rs src/models/place.rs src/models/plan_200_response.rs src/models/rental.rs src/models/rental_form_factor.rs src/models/rental_propulsion_type.rs src/models/rental_return_constraint.rs src/models/step_instruction.rs src/models/stop_time.rs src/models/stoptimes_200_response.rs src/models/trip_info.rs src/models/trip_segment.rs src/models/vertex_type.rs motis-openapi-sdk-1.0.0/.openapi-generator/VERSION000064400000000000000000000000071046102023000177270ustar 000000000000007.10.0 motis-openapi-sdk-1.0.0/.openapi-generator-ignore000064400000000000000000000020201046102023000200600ustar 00000000000000# OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md motis-openapi-sdk-1.0.0/.travis.yml000064400000000000000000000000171046102023000152740ustar 00000000000000language: rust motis-openapi-sdk-1.0.0/Cargo.toml0000644000000022560000000000100124000ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "motis-openapi-sdk" version = "1.0.0" authors = ["Julian Schmidhuber "] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "This is the MOTIS routing API." readme = "README.md" license = "MIT" [lib] name = "motis_openapi_sdk" path = "src/lib.rs" [dependencies.reqwest] version = "^0.12" features = [ "json", "multipart", ] [dependencies.serde] version = "^1.0" features = ["derive"] [dependencies.serde_json] version = "^1.0" [dependencies.serde_repr] version = "^0.1" [dependencies.url] version = "^2.5" [dependencies.uuid] version = "^1.8" features = [ "serde", "v4", ] motis-openapi-sdk-1.0.0/Cargo.toml.orig000064400000000000000000000006751046102023000160640ustar 00000000000000[package] name = "motis-openapi-sdk" version = "1.0.0" authors = ["Julian Schmidhuber "] description = "This is the MOTIS routing API." license = "MIT" edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } reqwest = { version = "^0.12", features = ["json", "multipart"] } motis-openapi-sdk-1.0.0/README.md000064400000000000000000000075451046102023000144570ustar 00000000000000# Rust API client for motis-openapi-sdk This is the MOTIS routing API. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - API version: v1 - Package version: v1 - Generator version: 7.10.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` ## Installation Put the package under your project folder in a directory named `motis-openapi-sdk` and add the following to `Cargo.toml` under `[dependencies]`: ``` motis-openapi-sdk = { path = "./motis-openapi-sdk" } ``` ## Documentation for API Endpoints All URIs are relative to *https://europe.motis-project.de* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *DebugApi* | [**footpaths**](docs/DebugApi.md#footpaths) | **GET** /api/debug/footpaths | Prints all footpaths of a timetable location (track, bus stop, etc.) *GeocodeApi* | [**geocode**](docs/GeocodeApi.md#geocode) | **GET** /api/v1/geocode | Autocompletion & geocoding that resolves user input addresses including coordinates *GeocodeApi* | [**one_to_many**](docs/GeocodeApi.md#one_to_many) | **GET** /api/v1/one-to-many | Street routing from one to many places or many to one. The order in the response array corresponds to the order of coordinates of the \\`many\\` parameter in the query. *GeocodeApi* | [**reverse_geocode**](docs/GeocodeApi.md#reverse_geocode) | **GET** /api/v1/reverse-geocode | Translate coordinates to the closest address(es)/places/stops. *MapApi* | [**initial**](docs/MapApi.md#initial) | **GET** /api/v1/map/initial | initial location to view the map at after loading based on where public transport should be visible *MapApi* | [**levels**](docs/MapApi.md#levels) | **GET** /api/v1/map/levels | Get all available levels for a map section *MapApi* | [**stops**](docs/MapApi.md#stops) | **GET** /api/v1/map/stops | Get all stops for a map section *MapApi* | [**trips**](docs/MapApi.md#trips) | **GET** /api/v1/map/trips | Given a area frame (box defined by top right and bottom left corner) and a time frame, it returns all trips and their respective shapes that operate in this area + time frame. Trips are filtered by zoom level. On low zoom levels, only long distance trains will be shown while on high zoom levels, also metros, buses and trams will be returned. *RoutingApi* | [**plan**](docs/RoutingApi.md#plan) | **GET** /api/v1/plan | Computes optimal connections from one place to another. *TimetableApi* | [**stoptimes**](docs/TimetableApi.md#stoptimes) | **GET** /api/v1/stoptimes | Get the next N departures or arrivals of a stop sorted by time *TimetableApi* | [**trip**](docs/TimetableApi.md#trip) | **GET** /api/v1/trip | Get a trip as itinerary ## Documentation For Models - [Area](docs/Area.md) - [Direction](docs/Direction.md) - [Duration](docs/Duration.md) - [EncodedPolyline](docs/EncodedPolyline.md) - [Footpath](docs/Footpath.md) - [Footpaths200Response](docs/Footpaths200Response.md) - [Initial200Response](docs/Initial200Response.md) - [Itinerary](docs/Itinerary.md) - [Leg](docs/Leg.md) - [Match](docs/Match.md) - [Mode](docs/Mode.md) - [PedestrianProfile](docs/PedestrianProfile.md) - [Place](docs/Place.md) - [Plan200Response](docs/Plan200Response.md) - [Rental](docs/Rental.md) - [RentalFormFactor](docs/RentalFormFactor.md) - [RentalPropulsionType](docs/RentalPropulsionType.md) - [RentalReturnConstraint](docs/RentalReturnConstraint.md) - [StepInstruction](docs/StepInstruction.md) - [StopTime](docs/StopTime.md) - [Stoptimes200Response](docs/Stoptimes200Response.md) - [TripInfo](docs/TripInfo.md) - [TripSegment](docs/TripSegment.md) - [VertexType](docs/VertexType.md) To get access to the crate's generated documentation, use: ``` cargo doc --open ``` ## Author felix@triptix.tech motis-openapi-sdk-1.0.0/docs/AbsoluteDirection.md000064400000000000000000000006311046102023000200560ustar 00000000000000# AbsoluteDirection ## Enum Variants | Name | Value | |---- | -----| | North | NORTH | | Northeast | NORTHEAST | | East | EAST | | Southeast | SOUTHEAST | | South | SOUTH | | Southwest | SOUTHWEST | | West | WEST | | Northwest | NORTHWEST | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Area.md000064400000000000000000000012301046102023000153030ustar 00000000000000# Area ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Name of the area | **admin_level** | **f64** | [OpenStreetMap `admin_level`](https://wiki.openstreetmap.org/wiki/Key:admin_level) of the area | **matched** | **bool** | Whether this area was matched by the input text | **default** | Option<**bool**> | Whether this area should be displayed as default area (area with admin level closest 7) | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/DebugApi.md000064400000000000000000000017711046102023000161250ustar 00000000000000# \DebugApi All URIs are relative to *https://europe.motis-project.de* Method | HTTP request | Description ------------- | ------------- | ------------- [**footpaths**](DebugApi.md#footpaths) | **GET** /api/debug/footpaths | Prints all footpaths of a timetable location (track, bus stop, etc.) ## footpaths > models::Footpaths200Response footpaths(id) Prints all footpaths of a timetable location (track, bus stop, etc.) ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **id** | **String** | location id | [required] | ### Return type [**models::Footpaths200Response**](footpaths_200_response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Direction.md000064400000000000000000000011531046102023000163570ustar 00000000000000# Direction ## Enum Variants | Name | Value | |---- | -----| | Depart | DEPART | | HardLeft | HARD_LEFT | | Left | LEFT | | SlightlyLeft | SLIGHTLY_LEFT | | Continue | CONTINUE | | SlightlyRight | SLIGHTLY_RIGHT | | Right | RIGHT | | HardRight | HARD_RIGHT | | CircleClockwise | CIRCLE_CLOCKWISE | | CircleCounterclockwise | CIRCLE_COUNTERCLOCKWISE | | Stairs | STAIRS | | Elevator | ELEVATOR | | UturnLeft | UTURN_LEFT | | UturnRight | UTURN_RIGHT | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Duration.md000064400000000000000000000006101046102023000162210ustar 00000000000000# Duration ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **duration** | Option<**f64**> | duration in seconds if a path was found, otherwise missing | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/EncodedPolyline.md000064400000000000000000000007301046102023000175140ustar 00000000000000# EncodedPolyline ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **points** | **String** | The encoded points of the polyline using the Google polyline encoding with precision 7. | **length** | **i32** | The number of points in the string | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Footpath.md000064400000000000000000000022001046102023000162150ustar 00000000000000# Footpath ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **to** | [**models::Place**](Place.md) | | **default** | Option<**f64**> | optional; missing if the GTFS did not contain a footpath footpath duration in minutes according to GTFS (+heuristics) | [optional] **foot** | Option<**f64**> | optional; missing if no path was found (timetable / osr) footpath duration in minutes for the foot profile | [optional] **foot_routed** | Option<**f64**> | optional; missing if no path was found with foot routing footpath duration in minutes for the foot profile | [optional] **wheelchair** | Option<**f64**> | optional; missing if no path was found with the wheelchair profile footpath duration in minutes for the wheelchair profile | [optional] **wheelchair_uses_elevator** | Option<**bool**> | optional; missing if no path was found with the wheelchair profile true if the wheelchair path uses an elevator | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Footpaths200Response.md000064400000000000000000000007011046102023000203450ustar 00000000000000# Footpaths200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **place** | [**models::Place**](Place.md) | | **footpaths** | [**Vec**](Footpath.md) | all outgoing footpaths of this location | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/GeocodeApi.md000064400000000000000000000071701046102023000164430ustar 00000000000000# \GeocodeApi All URIs are relative to *https://europe.motis-project.de* Method | HTTP request | Description ------------- | ------------- | ------------- [**geocode**](GeocodeApi.md#geocode) | **GET** /api/v1/geocode | Autocompletion & geocoding that resolves user input addresses including coordinates [**one_to_many**](GeocodeApi.md#one_to_many) | **GET** /api/v1/one-to-many | Street routing from one to many places or many to one. The order in the response array corresponds to the order of coordinates of the \\`many\\` parameter in the query. [**reverse_geocode**](GeocodeApi.md#reverse_geocode) | **GET** /api/v1/reverse-geocode | Translate coordinates to the closest address(es)/places/stops. ## geocode > Vec geocode(text, language) Autocompletion & geocoding that resolves user input addresses including coordinates ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **text** | **String** | the (potentially partially typed) address to resolve | [required] | **language** | Option<**String**> | language tags as used in OpenStreetMap (usually ISO 639-1, or ISO 639-2 if there's no ISO 639-1) | | ### Return type [**Vec**](Match.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## one_to_many > Vec one_to_many(one, many, mode, max, max_matching_distance, arrive_by) Street routing from one to many places or many to one. The order in the response array corresponds to the order of coordinates of the \\`many\\` parameter in the query. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **one** | **String** | geo location as latitude,longitude | [required] | **many** | [**Vec**](String.md) | geo locations as latitude;longitude,latitude;longitude,... | [required] | **mode** | [**Mode**](.md) | routing profile to use (currently supported: \\`WALK\\`, \\`BIKE\\`, \\`CAR\\`) | [required] | **max** | **f64** | maximum travel time in seconds | [required] | **max_matching_distance** | **f64** | maximum matching distance in meters to match geo coordinates to the street network | [required] | **arrive_by** | **bool** | true = many to one false = one to many | [required] | ### Return type [**Vec**](Duration.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## reverse_geocode > Vec reverse_geocode(place) Translate coordinates to the closest address(es)/places/stops. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **place** | **String** | latitude, longitude in degrees | [required] | ### Return type [**Vec**](Match.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Initial200Response.md000064400000000000000000000006151046102023000177730ustar 00000000000000# Initial200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **lat** | **f64** | latitude | **lon** | **f64** | longitude | **zoom** | **f64** | zoom level | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Itinerary.md000064400000000000000000000011041046102023000164010ustar 00000000000000# Itinerary ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **duration** | **i32** | journey duration in seconds | **start_time** | **String** | journey departure time | **end_time** | **String** | journey arrival time | **transfers** | **i32** | The number of transfers this trip has. | **legs** | [**Vec**](Leg.md) | Journey legs | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Leg.md000064400000000000000000000054531046102023000151550ustar 00000000000000# Leg ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mode** | [**models::Mode**](Mode.md) | Transport mode for this leg | **from** | [**models::Place**](Place.md) | | **to** | [**models::Place**](Place.md) | | **duration** | **i32** | Leg duration in seconds If leg is footpath: The footpath duration is derived from the default footpath duration using the query parameters `transferTimeFactor` and `additionalTransferTime` as follows: `leg.duration = defaultDuration * transferTimeFactor + additionalTransferTime.` In case the defaultDuration is needed, it can be calculated by `defaultDuration = (leg.duration - additionalTransferTime) / transferTimeFactor`. Note that the default values are `transferTimeFactor = 1` and `additionalTransferTime = 0` in case they are not explicitly provided in the query. | **start_time** | **String** | leg departure time | **end_time** | **String** | leg arrival time | **scheduled_start_time** | **String** | scheduled leg departure time | **scheduled_end_time** | **String** | scheduled leg arrival time | **real_time** | **bool** | Whether there is real-time data about this leg | **distance** | Option<**f64**> | For non-transit legs the distance traveled while traversing this leg in meters. | [optional] **interline_with_previous_leg** | Option<**bool**> | For transit legs, if the rider should stay on the vehicle as it changes route names. | [optional] **headsign** | Option<**String**> | For transit legs, the headsign of the bus or train being used. For non-transit legs, null | [optional] **route_color** | Option<**String**> | | [optional] **route_text_color** | Option<**String**> | | [optional] **route_type** | Option<**String**> | | [optional] **agency_name** | Option<**String**> | | [optional] **agency_url** | Option<**String**> | | [optional] **agency_id** | Option<**String**> | | [optional] **trip_id** | Option<**String**> | | [optional] **route_short_name** | Option<**String**> | | [optional] **source** | Option<**String**> | Filename and line number where this trip is from | [optional] **intermediate_stops** | Option<[**Vec**](Place.md)> | For transit legs, intermediate stops between the Place where the leg originates and the Place where the leg ends. For non-transit legs, null. | [optional] **leg_geometry** | [**models::EncodedPolyline**](EncodedPolyline.md) | | **steps** | Option<[**Vec**](StepInstruction.md)> | A series of turn by turn instructions used for walking, biking and driving. | [optional] **rental** | Option<[**models::Rental**](Rental.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/LevelEncodedPolyline.md000064400000000000000000000011531046102023000205040ustar 00000000000000# LevelEncodedPolyline ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **from_level** | **f64** | level where this segment starts, based on OpenStreetMap data | **to_level** | **f64** | level where this segment starts, based on OpenStreetMap data | **osm_way** | Option<**i32**> | OpenStreetMap way index | [optional] **polyline** | [**models::EncodedPolyline**](EncodedPolyline.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/MapApi.md000064400000000000000000000104451046102023000156120ustar 00000000000000# \MapApi All URIs are relative to *https://europe.motis-project.de* Method | HTTP request | Description ------------- | ------------- | ------------- [**initial**](MapApi.md#initial) | **GET** /api/v1/map/initial | initial location to view the map at after loading based on where public transport should be visible [**levels**](MapApi.md#levels) | **GET** /api/v1/map/levels | Get all available levels for a map section [**stops**](MapApi.md#stops) | **GET** /api/v1/map/stops | Get all stops for a map section [**trips**](MapApi.md#trips) | **GET** /api/v1/map/trips | Given a area frame (box defined by top right and bottom left corner) and a time frame, it returns all trips and their respective shapes that operate in this area + time frame. Trips are filtered by zoom level. On low zoom levels, only long distance trains will be shown while on high zoom levels, also metros, buses and trams will be returned. ## initial > models::Initial200Response initial() initial location to view the map at after loading based on where public transport should be visible ### Parameters This endpoint does not need any parameter. ### Return type [**models::Initial200Response**](initial_200_response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## levels > Vec levels(min, max) Get all available levels for a map section ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **min** | **String** | latitude,longitude pair of the lower right coordinate | [required] | **max** | **String** | latitude,longitude pair of the upper left coordinate | [required] | ### Return type **Vec** ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## stops > Vec stops(min, max) Get all stops for a map section ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **min** | **String** | latitude,longitude pair of the lower right coordinate | [required] | **max** | **String** | latitude,longitude pair of the upper left coordinate | [required] | ### Return type [**Vec**](Place.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## trips > Vec trips(zoom, min, max, start_time, end_time) Given a area frame (box defined by top right and bottom left corner) and a time frame, it returns all trips and their respective shapes that operate in this area + time frame. Trips are filtered by zoom level. On low zoom levels, only long distance trains will be shown while on high zoom levels, also metros, buses and trams will be returned. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **zoom** | **f64** | current zoom level | [required] | **min** | **String** | latitude,longitude pair of the lower right coordinate | [required] | **max** | **String** | latitude,longitude pair of the upper left coordinate | [required] | **start_time** | **String** | start of the time window | [required] | **end_time** | **String** | end if the time window | [required] | ### Return type [**Vec**](TripSegment.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Match.md000064400000000000000000000021151046102023000154720ustar 00000000000000# Match ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **r#type** | **String** | location type | **tokens** | [**Vec>**](Vec.md) | list of non-overlapping tokens that were matched | **name** | **String** | name of the location (transit stop / PoI / address) | **id** | **String** | unique ID of the location | **lat** | **f64** | latitude | **lon** | **f64** | longitude | **level** | Option<**f64**> | level according to OpenStreetMap (at the moment only for public transport) | [optional] **street** | Option<**String**> | street name | [optional] **house_number** | Option<**String**> | house number | [optional] **zip** | Option<**String**> | zip code | [optional] **areas** | [**Vec**](Area.md) | list of areas | **score** | **f64** | score according to the internal scoring system (the scoring algorithm might change in the future) | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Mode.md000064400000000000000000000012411046102023000153210ustar 00000000000000# Mode ## Enum Variants | Name | Value | |---- | -----| | Walk | WALK | | Bike | BIKE | | Rental | RENTAL | | Car | CAR | | CarParking | CAR_PARKING | | Transit | TRANSIT | | Tram | TRAM | | Subway | SUBWAY | | Ferry | FERRY | | Airplane | AIRPLANE | | Metro | METRO | | Bus | BUS | | Coach | COACH | | Rail | RAIL | | HighspeedRail | HIGHSPEED_RAIL | | LongDistance | LONG_DISTANCE | | NightRail | NIGHT_RAIL | | RegionalFastRail | REGIONAL_FAST_RAIL | | RegionalRail | REGIONAL_RAIL | | Other | OTHER | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/PedestrianProfile.md000064400000000000000000000004311046102023000200540ustar 00000000000000# PedestrianProfile ## Enum Variants | Name | Value | |---- | -----| | Foot | FOOT | | Wheelchair | WHEELCHAIR | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Place.md000064400000000000000000000024451046102023000154700ustar 00000000000000# Place ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | name of the transit stop / PoI / address | **stop_id** | Option<**String**> | The ID of the stop. This is often something that users don't care about. | [optional] **lat** | **f64** | latitude | **lon** | **f64** | longitude | **level** | **f64** | level according to OpenStreetMap | **arrival** | Option<**String**> | arrival time | [optional] **departure** | Option<**String**> | departure time | [optional] **scheduled_arrival** | Option<**String**> | scheduled arrival time | [optional] **scheduled_departure** | Option<**String**> | scheduled departure time | [optional] **scheduled_track** | Option<**String**> | scheduled track from the static schedule timetable dataset | [optional] **track** | Option<**String**> | The current track/platform information, updated with real-time updates if available. Can be missing if neither real-time updates nor the schedule timetable contains track information. | [optional] **vertex_type** | Option<[**models::VertexType**](VertexType.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Plan200Response.md000064400000000000000000000031471046102023000172770ustar 00000000000000# Plan200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **request_parameters** | **std::collections::HashMap** | the routing query | **debug_output** | **std::collections::HashMap** | debug statistics | **from** | [**models::Place**](Place.md) | | **to** | [**models::Place**](Place.md) | | **direct** | [**Vec**](Itinerary.md) | Direct trips by `WALK`, `BIKE`, `CAR`, etc. without time-dependency. The starting time (`arriveBy=false`) / arrival time (`arriveBy=true`) is always the queried `time` parameter (set to \\\"now\\\" if not set). But all `direct` connections are meant to be independent of absolute times. | **itineraries** | [**Vec**](Itinerary.md) | list of itineraries | **previous_page_cursor** | **String** | Use the cursor to get the previous page of results. Insert the cursor into the request and post it to get the previous page. The previous page is a set of itineraries departing BEFORE the first itinerary in the result for a depart after search. When using the default sort order the previous set of itineraries is inserted before the current result. | **next_page_cursor** | **String** | Use the cursor to get the next page of results. Insert the cursor into the request and post it to get the next page. The next page is a set of itineraries departing AFTER the last itinerary in this result. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/RelativeDirection.md000064400000000000000000000011371046102023000200550ustar 00000000000000# RelativeDirection ## Enum Variants | Name | Value | |---- | -----| | Depart | DEPART | | HardLeft | HARD_LEFT | | Left | LEFT | | SlightlyLeft | SLIGHTLY_LEFT | | Continue | CONTINUE | | SlightlyRight | SLIGHTLY_RIGHT | | Right | RIGHT | | HardRight | HARD_RIGHT | | CircleClockwise | CIRCLE_CLOCKWISE | | CircleCounterclockwise | CIRCLE_COUNTERCLOCKWISE | | Elevator | ELEVATOR | | UturnLeft | UTURN_LEFT | | UturnRight | UTURN_RIGHT | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Rental.md000064400000000000000000000023431046102023000156660ustar 00000000000000# Rental ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **system_id** | **String** | Vehicle share system ID | **system_name** | Option<**String**> | Vehicle share system name | [optional] **url** | Option<**String**> | URL of the vehicle share system | [optional] **station_name** | Option<**String**> | Name of the station | [optional] **rental_uri_android** | Option<**String**> | Rental URI for Android (deep link to the specific station or vehicle) | [optional] **rental_uri_ios** | Option<**String**> | Rental URI for iOS (deep link to the specific station or vehicle) | [optional] **rental_uri_web** | Option<**String**> | Rental URI for web (deep link to the specific station or vehicle) | [optional] **form_factor** | Option<[**models::RentalFormFactor**](RentalFormFactor.md)> | | [optional] **propulsion_type** | Option<[**models::RentalPropulsionType**](RentalPropulsionType.md)> | | [optional] **return_constraint** | Option<[**models::RentalReturnConstraint**](RentalReturnConstraint.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/RentalFormFactor.md000064400000000000000000000006371046102023000176550ustar 00000000000000# RentalFormFactor ## Enum Variants | Name | Value | |---- | -----| | Bicycle | BICYCLE | | CargoBicycle | CARGO_BICYCLE | | Car | CAR | | Moped | MOPED | | ScooterStanding | SCOOTER_STANDING | | ScooterSeated | SCOOTER_SEATED | | Other | OTHER | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/RentalPropulsionType.md000064400000000000000000000007441046102023000206260ustar 00000000000000# RentalPropulsionType ## Enum Variants | Name | Value | |---- | -----| | Human | HUMAN | | ElectricAssist | ELECTRIC_ASSIST | | Electric | ELECTRIC | | Combustion | COMBUSTION | | CombustionDiesel | COMBUSTION_DIESEL | | Hybrid | HYBRID | | PlugInHybrid | PLUG_IN_HYBRID | | HydrogenFuelCell | HYDROGEN_FUEL_CELL | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/RentalReturnConstraint.md000064400000000000000000000005101046102023000211250ustar 00000000000000# RentalReturnConstraint ## Enum Variants | Name | Value | |---- | -----| | None | NONE | | AnyStation | ANY_STATION | | RoundtripStation | ROUNDTRIP_STATION | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/RoutingApi.md000064400000000000000000000331711046102023000165250ustar 00000000000000# \RoutingApi All URIs are relative to *https://europe.motis-project.de* Method | HTTP request | Description ------------- | ------------- | ------------- [**plan**](RoutingApi.md#plan) | **GET** /api/v1/plan | Computes optimal connections from one place to another. ## plan > models::Plan200Response plan(from_place, to_place, detailed_transfers, via, via_minimum_stay, time, max_transfers, max_travel_time, min_transfer_time, additional_transfer_time, transfer_time_factor, max_matching_distance, pedestrian_profile, use_routed_transfers, transit_modes, direct_modes, pre_transit_modes, post_transit_modes, direct_rental_form_factors, pre_transit_rental_form_factors, post_transit_rental_form_factors, direct_rental_propulsion_types, pre_transit_rental_propulsion_types, post_transit_rental_propulsion_types, direct_rental_providers, pre_transit_rental_providers, post_transit_rental_providers, num_itineraries, page_cursor, timetable_view, arrive_by, search_window, require_bike_transport, max_pre_transit_time, max_post_transit_time, max_direct_time, timeout) Computes optimal connections from one place to another. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **from_place** | **String** | \\`latitude,longitude,level\\` tuple in degrees OR stop id | [required] | **to_place** | **String** | \\`latitude,longitude,level\\` tuple in degrees OR stop id | [required] | **detailed_transfers** | **bool** | - true: Compute transfer polylines and step instructions. - false: Only return basic information (start time, end time, duration) for transfers. | [required] |[default to true] **via** | Option<[**Vec**](String.md)> | List of via stops to visit (only stop IDs, no coordinates allowed for now). Also see the optional parameter `viaMinimumStay` to set a set a minimum stay duration for each via stop. | | **via_minimum_stay** | Option<[**Vec**](i32.md)> | Optional. If not set, the default is `0,0` - no stay required. For each `via` stop a minimum stay duration in minutes. The value `0` signals that it's allowed to stay in the same trip. This enables via stays without counting a transfer and can lead to better connections with less transfers. Transfer connections can still be found with `viaMinimumStay=0`. | |[default to [0,0]] **time** | Option<**String**> | Optional. Defaults to the current time. Departure time ($arriveBy=false) / arrival date ($arriveBy=true), | | **max_transfers** | Option<**i32**> | The maximum number of allowed transfers. If not provided, the routing uses the server-side default value which is hardcoded and very high to cover all use cases. *Warning*: Use with care. Setting this too low can lead to optimal (e.g. the fastest) journeys not being found. If this value is too low to reach the destination at all, it can lead to slow routing performance. | | **max_travel_time** | Option<**i32**> | The maximum travel time in minutes. If not provided, the routing to uses the value hardcoded in the server which is usually quite high. *Warning*: Use with care. Setting this too low can lead to optimal (e.g. the least transfers) journeys not being found. If this value is too low to reach the destination at all, it can lead to slow routing performance. | | **min_transfer_time** | Option<**i32**> | Optional. Default is 0 minutes. Minimum transfer time for each transfer in minutes. | |[default to 0] **additional_transfer_time** | Option<**i32**> | Optional. Default is 0 minutes. Additional transfer time reserved for each transfer in minutes. | |[default to 0] **transfer_time_factor** | Option<**f64**> | Optional. Default is 1.0 Factor to multiply minimum required transfer times with. Values smaller than 1.0 are not supported. | |[default to 1.0] **max_matching_distance** | Option<**f64**> | Optional. Default is 25 meters. Maximum matching distance in meters to match geo coordinates to the street network. | |[default to 25] **pedestrian_profile** | Option<[**PedestrianProfile**](.md)> | Optional. Default is `FOOT`. Accessibility profile to use for pedestrian routing in transfers between transit connections, on the first mile, and last mile. | |[default to FOOT] **use_routed_transfers** | Option<**bool**> | Optional. Default is `false`. Whether to use transfers routed on OpenStreetMap data. | |[default to false] **transit_modes** | Option<[**Vec**](models::Mode.md)> | Optional. Default is `TRANSIT` which allows all transit modes (no restriction). Allowed modes for the transit part. If empty, no transit connections will be computed. For example, this can be used to allow only `METRO,SUBWAY,TRAM`. | |[default to [TRANSIT]] **direct_modes** | Option<[**Vec**](models::Mode.md)> | Optional. Default is `WALK` which will compute walking routes as direct connections. Modes used for direction connections from start to destination without using transit. Results will be returned on the `direct` key. Note: Direct connections will only be returned on the first call. For paging calls, they can be omitted. Note: Transit connections that are slower than the fastest direct connection will not show up. This is being used as a cut-off during transit routing to speed up the search. To prevent this, it's possible to send two separate requests (one with only `transitModes` and one with only `directModes`). Only non-transit modes such as `WALK`, `BIKE`, `CAR`, `BIKE_SHARING`, etc. can be used. | |[default to ["WALK"]] **pre_transit_modes** | Option<[**Vec**](models::Mode.md)> | Optional. Default is `WALK`. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directModes`). A list of modes that are allowed to be used from the `from` coordinate to the first transit stop. Example: `WALK,BIKE_SHARING`. | |[default to [WALK]] **post_transit_modes** | Option<[**Vec**](models::Mode.md)> | Optional. Default is `WALK`. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directModes`). A list of modes that are allowed to be used from the last transit stop to the `to` coordinate. Example: `WALK,BIKE_SHARING`. | |[default to [WALK]] **direct_rental_form_factors** | Option<[**Vec**](models::RentalFormFactor.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies to direct connections. A list of vehicle type form factors that are allowed to be used for direct connections. If empty (the default), all form factors are allowed. Example: `BICYCLE,SCOOTER_STANDING`. | | **pre_transit_rental_form_factors** | Option<[**Vec**](models::RentalFormFactor.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalFormFactors`). A list of vehicle type form factors that are allowed to be used from the `from` coordinate to the first transit stop. If empty (the default), all form factors are allowed. Example: `BICYCLE,SCOOTER_STANDING`. | | **post_transit_rental_form_factors** | Option<[**Vec**](models::RentalFormFactor.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalFormFactors`). A list of vehicle type form factors that are allowed to be used from the last transit stop to the `to` coordinate. If empty (the default), all form factors are allowed. Example: `BICYCLE,SCOOTER_STANDING`. | | **direct_rental_propulsion_types** | Option<[**Vec**](models::RentalPropulsionType.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies to direct connections. A list of vehicle type form factors that are allowed to be used for direct connections. If empty (the default), all propulsion types are allowed. Example: `HUMAN,ELECTRIC,ELECTRIC_ASSIST`. | | **pre_transit_rental_propulsion_types** | Option<[**Vec**](models::RentalPropulsionType.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalPropulsionTypes`). A list of vehicle propulsion types that are allowed to be used from the `from` coordinate to the first transit stop. If empty (the default), all propulsion types are allowed. Example: `HUMAN,ELECTRIC,ELECTRIC_ASSIST`. | | **post_transit_rental_propulsion_types** | Option<[**Vec**](models::RentalPropulsionType.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalPropulsionTypes`). A list of vehicle propulsion types that are allowed to be used from the last transit stop to the `to` coordinate. If empty (the default), all propulsion types are allowed. Example: `HUMAN,ELECTRIC,ELECTRIC_ASSIST`. | | **direct_rental_providers** | Option<[**Vec**](String.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies to direct connections. A list of rental providers that are allowed to be used for direct connections. If empty (the default), all providers are allowed. | | **pre_transit_rental_providers** | Option<[**Vec**](String.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalProviders`). A list of rental providers that are allowed to be used from the `from` coordinate to the first transit stop. If empty (the default), all providers are allowed. | | **post_transit_rental_providers** | Option<[**Vec**](String.md)> | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalProviders`). A list of rental providers that are allowed to be used from the last transit stop to the `to` coordinate. If empty (the default), all providers are allowed. | | **num_itineraries** | Option<**i32**> | The minimum number of itineraries to compute. This is only relevant if `timetableView=true`. The default value is 5. | |[default to 5] **page_cursor** | Option<**String**> | Use the cursor to go to the next \"page\" of itineraries. Copy the cursor from the last response and keep the original request as is. This will enable you to search for itineraries in the next or previous time-window. | | **timetable_view** | Option<**bool**> | Optional. Default is `true`. Search for the best trip options within a time window. If true two itineraries are considered optimal if one is better on arrival time (earliest wins) and the other is better on departure time (latest wins). In combination with arriveBy this parameter cover the following use cases: `timetable=false` = waiting for the first transit departure/arrival is considered travel time: - `arriveBy=true`: event (e.g. a meeting) starts at 10:00 am, compute the best journeys that arrive by that time (maximizes departure time) - `arriveBy=false`: event (e.g. a meeting) ends at 11:00 am, compute the best journeys that depart after that time `timetable=true` = optimize \"later departure\" + \"earlier arrival\" and give all options over a time window: - `arriveBy=true`: the time window around `date` and `time` refers to the arrival time window - `arriveBy=false`: the time window around `date` and `time` refers to the departure time window | |[default to true] **arrive_by** | Option<**bool**> | Optional. Default is `false`. - `arriveBy=true`: the parameters `date` and `time` refer to the arrival time - `arriveBy=false`: the parameters `date` and `time` refer to the departure time | |[default to false] **search_window** | Option<**i32**> | Optional. Default is 2 hours which is `7200`. The length of the search-window in seconds. Default value two hours. - `arriveBy=true`: number of seconds between the earliest departure time and latest departure time - `arriveBy=false`: number of seconds between the earliest arrival time and the latest arrival time | |[default to 7200] **require_bike_transport** | Option<**bool**> | Optional. Default is `false`. If set to `true`, all used transit trips are required to allow bike carriage. | |[default to false] **max_pre_transit_time** | Option<**i32**> | Optional. Default is 15min which is `900`. Maximum time in seconds for the first street leg. | |[default to 900] **max_post_transit_time** | Option<**i32**> | Optional. Default is 15min which is `900`. Maximum time in seconds for the last street leg. | |[default to 900] **max_direct_time** | Option<**i32**> | Optional. Default is 30min which is `1800`. Maximum time in seconds for direct connections. | |[default to 1800] **timeout** | Option<**i32**> | Optional. Query timeout in seconds. | | ### Return type [**models::Plan200Response**](plan_200_response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/StepInstruction.md000064400000000000000000000022711046102023000176160ustar 00000000000000# StepInstruction ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **relative_direction** | [**models::Direction**](Direction.md) | | **distance** | **f64** | The distance in meters that this step takes. | **from_level** | **f64** | level where this segment starts, based on OpenStreetMap data | **to_level** | **f64** | level where this segment starts, based on OpenStreetMap data | **osm_way** | Option<**i32**> | OpenStreetMap way index | [optional] **polyline** | [**models::EncodedPolyline**](EncodedPolyline.md) | | **street_name** | **String** | The name of the street. | **exit** | **String** | Not implemented! When exiting a highway or traffic circle, the exit name/number. | **stay_on** | **bool** | Not implemented! Indicates whether or not a street changes direction at an intersection. | **area** | **bool** | Not implemented! This step is on an open area, such as a plaza or train platform, and thus the directions should say something like \"cross\" | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/StopTime.md000064400000000000000000000017611046102023000162100ustar 00000000000000# StopTime ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **place** | [**models::Place**](Place.md) | information about the stop place and time | **mode** | [**models::Mode**](Mode.md) | Transport mode for this leg | **real_time** | **bool** | Whether there is real-time data about this leg | **headsign** | **String** | For transit legs, the headsign of the bus or train being used. For non-transit legs, null | **agency_id** | **String** | | **agency_name** | **String** | | **agency_url** | **String** | | **route_color** | Option<**String**> | | [optional] **route_text_color** | Option<**String**> | | [optional] **trip_id** | **String** | | **route_short_name** | **String** | | **source** | **String** | Filename and line number where this trip is from | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/Stoptimes200Response.md000064400000000000000000000015441046102023000203730ustar 00000000000000# Stoptimes200Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stop_times** | [**Vec**](StopTime.md) | list of stop times | **previous_page_cursor** | **String** | Use the cursor to get the previous page of results. Insert the cursor into the request and post it to get the previous page. The previous page is a set of stop times BEFORE the first stop time in the result. | **next_page_cursor** | **String** | Use the cursor to get the next page of results. Insert the cursor into the request and post it to get the next page. The next page is a set of stop times AFTER the last stop time in this result. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/TimetableApi.md000064400000000000000000000064521046102023000170060ustar 00000000000000# \TimetableApi All URIs are relative to *https://europe.motis-project.de* Method | HTTP request | Description ------------- | ------------- | ------------- [**stoptimes**](TimetableApi.md#stoptimes) | **GET** /api/v1/stoptimes | Get the next N departures or arrivals of a stop sorted by time [**trip**](TimetableApi.md#trip) | **GET** /api/v1/trip | Get a trip as itinerary ## stoptimes > models::Stoptimes200Response stoptimes(stop_id, n, time, arrive_by, direction, mode, radius, page_cursor) Get the next N departures or arrivals of a stop sorted by time ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **stop_id** | **String** | stop id of the stop to retrieve departures/arrivals for | [required] | **n** | **i32** | the number of events | [required] | **time** | Option<**String**> | Optional. Defaults to the current time. | | **arrive_by** | Option<**bool**> | Optional. Default is `false`. - `arriveBy=true`: the parameters `date` and `time` refer to the arrival time - `arriveBy=false`: the parameters `date` and `time` refer to the departure time | |[default to false] **direction** | Option<**String**> | This parameter will be ignored in case `pageCursor` is set. Optional. Default is - `LATER` for `arriveBy=false` - `EARLIER` for `arriveBy=true` The response will contain the next `n` arrivals / departures in case `EARLIER` is selected and the previous `n` arrivals / departures if `LATER` is selected. | | **mode** | Option<[**Vec**](models::Mode.md)> | Optional. Default is all transit modes. Only return arrivals/departures of the given modes. | |[default to ["TRANSIT"]] **radius** | Option<**i32**> | Optional. Radius in meters. Default is that only stop times of the parent of the stop itself and all stops with the same name (+ their child stops) are returned. If set, all stops at parent stations and their child stops in the specified radius are returned. | | **page_cursor** | Option<**String**> | Use the cursor to go to the next \"page\" of stop times. Copy the cursor from the last response and keep the original request as is. This will enable you to search for stop times in the next or previous time-window. | | ### Return type [**models::Stoptimes200Response**](stoptimes_200_response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## trip > models::Itinerary trip(trip_id) Get a trip as itinerary ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **trip_id** | **String** | trip identifier (e.g. from an itinerary leg or stop event) | [required] | ### Return type [**models::Itinerary**](Itinerary.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/TripInfo.md000064400000000000000000000006561046102023000162000ustar 00000000000000# TripInfo ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **trip_id** | **String** | trip ID (dataset trip id prefixed with the dataset tag) | **route_short_name** | **String** | trip display name | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/TripSegment.md000064400000000000000000000020241046102023000166760ustar 00000000000000# TripSegment ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **trips** | [**Vec**](TripInfo.md) | | **route_color** | Option<**String**> | | [optional] **mode** | [**models::Mode**](Mode.md) | Transport mode for this leg | **distance** | **f64** | distance in meters | **from** | [**models::Place**](Place.md) | | **to** | [**models::Place**](Place.md) | | **departure** | **String** | departure time | **arrival** | **String** | arrival time | **scheduled_departure** | **String** | scheduled departure time | **scheduled_arrival** | **String** | scheduled arrival time | **real_time** | **bool** | Whether there is real-time data about this leg | **polyline** | **String** | Google polyline encoded coordinate sequence (with precision 7) where the trip travels on this segment. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/docs/VertexType.md000064400000000000000000000004521046102023000165570ustar 00000000000000# VertexType ## Enum Variants | Name | Value | |---- | -----| | Normal | NORMAL | | Bikeshare | BIKESHARE | | Transit | TRANSIT | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) motis-openapi-sdk-1.0.0/generate.sh000064400000000000000000000011641046102023000153150ustar 00000000000000curl -o openapi.yml https://raw.githubusercontent.com/motis-project/motis/refs/heads/master/openapi.yaml openapi-generator-cli generate -g rust -i openapi.yml --package-name motis-openapi-sdk # Bug in the generator, fixed in https://github.com/OpenAPITools/openapi-generator/pull/19946 sed -i 's/version = "1"/version = "1.0.0"/' Cargo.toml # Change autor of autogenerated package; it is different from the autor of the OpenAPI specification. sed -i 's/felix@triptix.tech/Julian Schmidhuber /' Cargo.toml # Disable clippy on generated code. sed -i '1s/^/#![allow(clippy::all)]\n/' src/lib.rs motis-openapi-sdk-1.0.0/git_push.sh000064400000000000000000000034461046102023000153520ustar 00000000000000#!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 git_host=$4 if [ "$git_host" = "" ]; then git_host="github.com" echo "[INFO] No command line input provided. Set \$git_host to $git_host" fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi if [ "$release_note" = "" ]; then release_note="Minor update" echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi # Initialize the local directory as a Git repository git init # Adds the files in the local repository and stages them for commit. git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' motis-openapi-sdk-1.0.0/openapi.yml000064400000000000000000001517421046102023000153550ustar 00000000000000openapi: 3.1.0 info: title: MOTIS API description: This is the MOTIS routing API. contact: email: felix@triptix.tech license: name: MIT url: https://opensource.org/license/mit version: v1 externalDocs: description: Find out more about MOTIS url: https://github.com/motis-project/motis servers: - url: https://europe.motis-project.de paths: /api/v1/one-to-many: get: tags: - geocode summary: | Street routing from one to many places or many to one. The order in the response array corresponds to the order of coordinates of the \`many\` parameter in the query. operationId: oneToMany parameters: - name: one in: query required: true description: geo location as latitude,longitude schema: type: string - name: many in: query required: true description: geo locations as latitude;longitude,latitude;longitude,... schema: type: array items: type: string - name: mode in: query required: true description: | routing profile to use (currently supported: \`WALK\`, \`BIKE\`, \`CAR\`) schema: $ref: '#/components/schemas/Mode' - name: max in: query required: true description: maximum travel time in seconds schema: type: number - name: maxMatchingDistance in: query required: true description: maximum matching distance in meters to match geo coordinates to the street network schema: type: number - name: arriveBy in: query required: true description: | true = many to one false = one to many schema: type: boolean responses: 200: description: | A list of durations. If no path was found, the object is empty. content: application/json: schema: type: array items: $ref: '#/components/schemas/Duration' /api/v1/reverse-geocode: get: tags: - geocode summary: Translate coordinates to the closest address(es)/places/stops. operationId: reverseGeocode parameters: - name: place in: query required: true description: latitude, longitude in degrees schema: type: string responses: 200: description: A list of guesses to resolve the coordinates to a location content: application/json: schema: type: array items: $ref: '#/components/schemas/Match' /api/v1/geocode: get: tags: - geocode summary: Autocompletion & geocoding that resolves user input addresses including coordinates operationId: geocode parameters: - name: text in: query required: true description: the (potentially partially typed) address to resolve schema: type: string - name: language in: query required: false description: | language tags as used in OpenStreetMap (usually ISO 639-1, or ISO 639-2 if there's no ISO 639-1) schema: type: string responses: 200: description: A list of guesses to resolve the text to a location content: application/json: schema: type: array items: $ref: '#/components/schemas/Match' /api/v1/trip: get: tags: - timetable summary: Get a trip as itinerary operationId: trip parameters: - name: tripId in: query schema: type: string required: true description: trip identifier (e.g. from an itinerary leg or stop event) responses: 200: description: the requested trip as itinerary content: application/json: schema: $ref: '#/components/schemas/Itinerary' /api/v1/stoptimes: get: tags: - timetable summary: Get the next N departures or arrivals of a stop sorted by time operationId: stoptimes parameters: - name: stopId in: query schema: type: string required: true description: stop id of the stop to retrieve departures/arrivals for - name: time in: query required: false description: | Optional. Defaults to the current time. schema: type: string format: date-time - name: arriveBy in: query required: false schema: type: boolean default: false description: | Optional. Default is `false`. - `arriveBy=true`: the parameters `date` and `time` refer to the arrival time - `arriveBy=false`: the parameters `date` and `time` refer to the departure time - name: direction in: query required: false schema: type: string enum: - EARLIER - LATER description: | This parameter will be ignored in case `pageCursor` is set. Optional. Default is - `LATER` for `arriveBy=false` - `EARLIER` for `arriveBy=true` The response will contain the next `n` arrivals / departures in case `EARLIER` is selected and the previous `n` arrivals / departures if `LATER` is selected. - name: mode in: query schema: type: array items: $ref: '#/components/schemas/Mode' default: - TRANSIT description: | Optional. Default is all transit modes. Only return arrivals/departures of the given modes. - name: n in: query schema: type: integer required: true description: the number of events - name: radius in: query schema: type: integer required: false description: | Optional. Radius in meters. Default is that only stop times of the parent of the stop itself and all stops with the same name (+ their child stops) are returned. If set, all stops at parent stations and their child stops in the specified radius are returned. - name: pageCursor in: query required: false description: | Use the cursor to go to the next "page" of stop times. Copy the cursor from the last response and keep the original request as is. This will enable you to search for stop times in the next or previous time-window. schema: type: string responses: 200: description: A list of guesses to resolve the text to a location content: application/json: schema: type: object required: - stopTimes - previousPageCursor - nextPageCursor properties: stopTimes: description: list of stop times type: array items: $ref: '#/components/schemas/StopTime' previousPageCursor: description: | Use the cursor to get the previous page of results. Insert the cursor into the request and post it to get the previous page. The previous page is a set of stop times BEFORE the first stop time in the result. type: string nextPageCursor: description: | Use the cursor to get the next page of results. Insert the cursor into the request and post it to get the next page. The next page is a set of stop times AFTER the last stop time in this result. type: string /api/v1/plan: get: tags: - routing summary: Computes optimal connections from one place to another. operationId: plan parameters: - name: fromPlace in: query required: true description: \`latitude,longitude,level\` tuple in degrees OR stop id schema: type: string - name: toPlace in: query required: true description: \`latitude,longitude,level\` tuple in degrees OR stop id schema: type: string - name: via in: query required: false description: | List of via stops to visit (only stop IDs, no coordinates allowed for now). Also see the optional parameter `viaMinimumStay` to set a set a minimum stay duration for each via stop. schema: type: array maxItems: 2 items: type: string explode: false - name: viaMinimumStay in: query required: false description: | Optional. If not set, the default is `0,0` - no stay required. For each `via` stop a minimum stay duration in minutes. The value `0` signals that it's allowed to stay in the same trip. This enables via stays without counting a transfer and can lead to better connections with less transfers. Transfer connections can still be found with `viaMinimumStay=0`. schema: default: [ 0, 0 ] type: array maxItems: 2 items: type: integer explode: false - name: time in: query required: false description: | Optional. Defaults to the current time. Departure time ($arriveBy=false) / arrival date ($arriveBy=true), schema: type: string format: date-time - name: maxTransfers in: query required: false description: | The maximum number of allowed transfers. If not provided, the routing uses the server-side default value which is hardcoded and very high to cover all use cases. *Warning*: Use with care. Setting this too low can lead to optimal (e.g. the fastest) journeys not being found. If this value is too low to reach the destination at all, it can lead to slow routing performance. schema: type: integer - name: maxTravelTime in: query required: false description: | The maximum travel time in minutes. If not provided, the routing to uses the value hardcoded in the server which is usually quite high. *Warning*: Use with care. Setting this too low can lead to optimal (e.g. the least transfers) journeys not being found. If this value is too low to reach the destination at all, it can lead to slow routing performance. schema: type: integer - name: minTransferTime in: query required: false description: | Optional. Default is 0 minutes. Minimum transfer time for each transfer in minutes. schema: type: integer default: 0 - name: additionalTransferTime in: query required: false description: | Optional. Default is 0 minutes. Additional transfer time reserved for each transfer in minutes. schema: type: integer default: 0 - name: transferTimeFactor in: query required: false description: | Optional. Default is 1.0 Factor to multiply minimum required transfer times with. Values smaller than 1.0 are not supported. schema: type: number default: 1.0 - name: maxMatchingDistance in: query required: false description: | Optional. Default is 25 meters. Maximum matching distance in meters to match geo coordinates to the street network. schema: type: number default: 25 - name: pedestrianProfile in: query required: false description: | Optional. Default is `FOOT`. Accessibility profile to use for pedestrian routing in transfers between transit connections, on the first mile, and last mile. schema: $ref: '#/components/schemas/PedestrianProfile' default: FOOT - name: useRoutedTransfers in: query required: false description: | Optional. Default is `false`. Whether to use transfers routed on OpenStreetMap data. schema: type: boolean default: false - name: detailedTransfers in: query required: true description: | - true: Compute transfer polylines and step instructions. - false: Only return basic information (start time, end time, duration) for transfers. schema: type: boolean default: true - name: transitModes in: query required: false description: | Optional. Default is `TRANSIT` which allows all transit modes (no restriction). Allowed modes for the transit part. If empty, no transit connections will be computed. For example, this can be used to allow only `METRO,SUBWAY,TRAM`. schema: default: - TRANSIT type: array items: $ref: '#/components/schemas/Mode' explode: false - name: directModes in: query required: false description: | Optional. Default is `WALK` which will compute walking routes as direct connections. Modes used for direction connections from start to destination without using transit. Results will be returned on the `direct` key. Note: Direct connections will only be returned on the first call. For paging calls, they can be omitted. Note: Transit connections that are slower than the fastest direct connection will not show up. This is being used as a cut-off during transit routing to speed up the search. To prevent this, it's possible to send two separate requests (one with only `transitModes` and one with only `directModes`). Only non-transit modes such as `WALK`, `BIKE`, `CAR`, `BIKE_SHARING`, etc. can be used. schema: default: - WALK type: array items: $ref: '#/components/schemas/Mode' explode: false - name: preTransitModes in: query required: false description: | Optional. Default is `WALK`. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directModes`). A list of modes that are allowed to be used from the `from` coordinate to the first transit stop. Example: `WALK,BIKE_SHARING`. schema: default: - WALK type: array items: $ref: '#/components/schemas/Mode' explode: false - name: postTransitModes in: query required: false description: | Optional. Default is `WALK`. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directModes`). A list of modes that are allowed to be used from the last transit stop to the `to` coordinate. Example: `WALK,BIKE_SHARING`. schema: default: - WALK type: array items: $ref: '#/components/schemas/Mode' explode: false - name: directRentalFormFactors in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies to direct connections. A list of vehicle type form factors that are allowed to be used for direct connections. If empty (the default), all form factors are allowed. Example: `BICYCLE,SCOOTER_STANDING`. schema: type: array items: $ref: '#/components/schemas/RentalFormFactor' explode: false - name: preTransitRentalFormFactors in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalFormFactors`). A list of vehicle type form factors that are allowed to be used from the `from` coordinate to the first transit stop. If empty (the default), all form factors are allowed. Example: `BICYCLE,SCOOTER_STANDING`. schema: type: array items: $ref: '#/components/schemas/RentalFormFactor' explode: false - name: postTransitRentalFormFactors in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalFormFactors`). A list of vehicle type form factors that are allowed to be used from the last transit stop to the `to` coordinate. If empty (the default), all form factors are allowed. Example: `BICYCLE,SCOOTER_STANDING`. schema: type: array items: $ref: '#/components/schemas/RentalFormFactor' explode: false - name: directRentalPropulsionTypes in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies to direct connections. A list of vehicle type form factors that are allowed to be used for direct connections. If empty (the default), all propulsion types are allowed. Example: `HUMAN,ELECTRIC,ELECTRIC_ASSIST`. schema: type: array items: $ref: '#/components/schemas/RentalPropulsionType' explode: false - name: preTransitRentalPropulsionTypes in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalPropulsionTypes`). A list of vehicle propulsion types that are allowed to be used from the `from` coordinate to the first transit stop. If empty (the default), all propulsion types are allowed. Example: `HUMAN,ELECTRIC,ELECTRIC_ASSIST`. schema: type: array items: $ref: '#/components/schemas/RentalPropulsionType' explode: false - name: postTransitRentalPropulsionTypes in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalPropulsionTypes`). A list of vehicle propulsion types that are allowed to be used from the last transit stop to the `to` coordinate. If empty (the default), all propulsion types are allowed. Example: `HUMAN,ELECTRIC,ELECTRIC_ASSIST`. schema: type: array items: $ref: '#/components/schemas/RentalPropulsionType' explode: false - name: directRentalProviders in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies to direct connections. A list of rental providers that are allowed to be used for direct connections. If empty (the default), all providers are allowed. schema: type: array items: type: string - name: preTransitRentalProviders in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalProviders`). A list of rental providers that are allowed to be used from the `from` coordinate to the first transit stop. If empty (the default), all providers are allowed. schema: type: array items: type: string - name: postTransitRentalProviders in: query required: false description: | Experimental. Expect unannounced breaking changes (without version bumps). Optional. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directRentalProviders`). A list of rental providers that are allowed to be used from the last transit stop to the `to` coordinate. If empty (the default), all providers are allowed. schema: type: array items: type: string - name: numItineraries in: query required: false description: | The minimum number of itineraries to compute. This is only relevant if `timetableView=true`. The default value is 5. schema: type: integer default: 5 - name: pageCursor in: query required: false description: | Use the cursor to go to the next "page" of itineraries. Copy the cursor from the last response and keep the original request as is. This will enable you to search for itineraries in the next or previous time-window. schema: type: string - name: timetableView in: query required: false description: | Optional. Default is `true`. Search for the best trip options within a time window. If true two itineraries are considered optimal if one is better on arrival time (earliest wins) and the other is better on departure time (latest wins). In combination with arriveBy this parameter cover the following use cases: `timetable=false` = waiting for the first transit departure/arrival is considered travel time: - `arriveBy=true`: event (e.g. a meeting) starts at 10:00 am, compute the best journeys that arrive by that time (maximizes departure time) - `arriveBy=false`: event (e.g. a meeting) ends at 11:00 am, compute the best journeys that depart after that time `timetable=true` = optimize "later departure" + "earlier arrival" and give all options over a time window: - `arriveBy=true`: the time window around `date` and `time` refers to the arrival time window - `arriveBy=false`: the time window around `date` and `time` refers to the departure time window schema: type: boolean default: true - name: arriveBy in: query required: false schema: type: boolean default: false description: | Optional. Default is `false`. - `arriveBy=true`: the parameters `date` and `time` refer to the arrival time - `arriveBy=false`: the parameters `date` and `time` refer to the departure time - name: searchWindow in: query required: false description: | Optional. Default is 2 hours which is `7200`. The length of the search-window in seconds. Default value two hours. - `arriveBy=true`: number of seconds between the earliest departure time and latest departure time - `arriveBy=false`: number of seconds between the earliest arrival time and the latest arrival time schema: type: integer default: 7200 minimum: 0 - name: requireBikeTransport in: query required: false schema: type: boolean default: false description: | Optional. Default is `false`. If set to `true`, all used transit trips are required to allow bike carriage. - name: maxPreTransitTime in: query required: false description: | Optional. Default is 15min which is `900`. Maximum time in seconds for the first street leg. schema: type: integer default: 900 minimum: 0 - name: maxPostTransitTime in: query required: false description: | Optional. Default is 15min which is `900`. Maximum time in seconds for the last street leg. schema: type: integer default: 900 minimum: 0 - name: maxDirectTime in: query required: false description: | Optional. Default is 30min which is `1800`. Maximum time in seconds for direct connections. schema: type: integer default: 1800 minimum: 0 - name: timeout in: query required: false description: Optional. Query timeout in seconds. schema: type: integer minimum: 0 responses: '200': description: routing result content: application/json: schema: type: object required: - requestParameters - debugOutput - date - from - to - direct - itineraries - previousPageCursor - nextPageCursor properties: requestParameters: description: "the routing query" type: object additionalProperties: type: string debugOutput: description: "debug statistics" type: object additionalProperties: type: integer from: $ref: '#/components/schemas/Place' to: $ref: '#/components/schemas/Place' direct: description: | Direct trips by `WALK`, `BIKE`, `CAR`, etc. without time-dependency. The starting time (`arriveBy=false`) / arrival time (`arriveBy=true`) is always the queried `time` parameter (set to \"now\" if not set). But all `direct` connections are meant to be independent of absolute times. type: array items: $ref: '#/components/schemas/Itinerary' itineraries: description: list of itineraries type: array items: $ref: '#/components/schemas/Itinerary' previousPageCursor: description: | Use the cursor to get the previous page of results. Insert the cursor into the request and post it to get the previous page. The previous page is a set of itineraries departing BEFORE the first itinerary in the result for a depart after search. When using the default sort order the previous set of itineraries is inserted before the current result. type: string nextPageCursor: description: | Use the cursor to get the next page of results. Insert the cursor into the request and post it to get the next page. The next page is a set of itineraries departing AFTER the last itinerary in this result. type: string /api/v1/map/trips: get: tags: - map operationId: trips summary: | Given a area frame (box defined by top right and bottom left corner) and a time frame, it returns all trips and their respective shapes that operate in this area + time frame. Trips are filtered by zoom level. On low zoom levels, only long distance trains will be shown while on high zoom levels, also metros, buses and trams will be returned. parameters: - name: zoom in: query required: true description: current zoom level schema: type: number - name: min in: query required: true description: latitude,longitude pair of the lower right coordinate schema: type: string - name: max in: query required: true description: latitude,longitude pair of the upper left coordinate schema: type: string - name: startTime in: query required: true description: start of the time window schema: type: string format: date-time - name: endTime in: query required: true description: end if the time window schema: type: string format: date-time responses: '200': description: a list of trips content: application/json: schema: type: array items: $ref: '#/components/schemas/TripSegment' /api/v1/map/initial: get: tags: - map operationId: initial summary: initial location to view the map at after loading based on where public transport should be visible responses: '200': description: latitude, longitude and zoom level to set the map to content: application/json: schema: type: object required: - lat - lon - zoom properties: lat: description: latitude type: number lon: description: longitude type: number zoom: description: zoom level type: number /api/v1/map/stops: get: tags: - map summary: Get all stops for a map section operationId: stops parameters: - name: min in: query required: true description: latitude,longitude pair of the lower right coordinate schema: type: string - name: max in: query required: true description: latitude,longitude pair of the upper left coordinate schema: type: string responses: '200': description: array of stop places in the selected map section content: application/json: schema: type: array items: $ref: '#/components/schemas/Place' /api/v1/map/levels: get: tags: - map summary: Get all available levels for a map section operationId: levels parameters: - name: min in: query required: true description: latitude,longitude pair of the lower right coordinate schema: type: string - name: max in: query required: true description: latitude,longitude pair of the upper left coordinate schema: type: string responses: '200': description: array of available levels content: application/json: schema: type: array items: type: number /api/debug/footpaths: get: tags: - debug summary: Prints all footpaths of a timetable location (track, bus stop, etc.) operationId: footpaths parameters: - name: id in: query required: true description: location id schema: type: string responses: '200': description: list of outgoing footpaths of this location content: application/json: schema: type: object required: - place - footpaths properties: place: $ref: '#/components/schemas/Place' footpaths: description: all outgoing footpaths of this location type: array items: $ref: '#/components/schemas/Footpath' components: schemas: Duration: description: Object containing duration if a path was found or none if no path was found type: object required: [ ] properties: duration: type: number description: duration in seconds if a path was found, otherwise missing Area: description: Administrative area type: object required: - name - adminLevel - matched properties: name: type: string description: Name of the area adminLevel: type: number description: | [OpenStreetMap `admin_level`](https://wiki.openstreetmap.org/wiki/Key:admin_level) of the area matched: type: boolean description: Whether this area was matched by the input text default: type: boolean description: Whether this area should be displayed as default area (area with admin level closest 7) Token: description: Matched token range (from index, length) type: array minItems: 2 maxItems: 2 items: type: number Match: description: GeoCoding match type: object required: - type - name - id - lat - lon - tokens - areas - score properties: type: description: location type type: string enum: - ADDRESS - PLACE - STOP tokens: description: list of non-overlapping tokens that were matched type: array items: $ref: '#/components/schemas/Token' name: description: name of the location (transit stop / PoI / address) type: string id: description: unique ID of the location type: string lat: description: latitude type: number lon: description: longitude type: number level: description: | level according to OpenStreetMap (at the moment only for public transport) type: number street: description: street name type: string houseNumber: description: house number type: string zip: description: zip code type: string areas: description: list of areas type: array items: $ref: '#/components/schemas/Area' score: description: score according to the internal scoring system (the scoring algorithm might change in the future) type: number PedestrianProfile: description: Different accessibility profiles for pedestrians. type: string enum: - FOOT - WHEELCHAIR Mode: description: | # Street modes - `WALK` - `BIKE` - `RENTAL` Experimental. Expect unannounced breaking changes (without version bumps). - `CAR` - `CAR_PARKING` # Transit modes - `TRANSIT`: translates to `RAIL,SUBWAY,TRAM,BUS,FERRY,AIRPLANE,COACH` - `TRAM`: trams - `SUBWAY`: subway trains - `FERRY`: ferries - `AIRPLANE`: airline flights - `BUS`: short distance buses (does not include `COACH`) - `COACH`: long distance buses (does not include `BUS`) - `RAIL`: translates to `HIGHSPEED_RAIL,LONG_DISTANCE_RAIL,NIGHT_RAIL,REGIONAL_RAIL,REGIONAL_FAST_RAIL` - `METRO`: metro trains - `HIGHSPEED_RAIL`: long distance high speed trains (e.g. TGV) - `LONG_DISTANCE`: long distance inter city trains - `NIGHT_RAIL`: long distance night trains - `REGIONAL_FAST_RAIL`: regional express routes that skip low traffic stops to be faster - `REGIONAL_RAIL`: regional train type: string enum: # === Street === - WALK - BIKE - RENTAL - CAR - CAR_PARKING # === Transit === - TRANSIT - TRAM - SUBWAY - FERRY - AIRPLANE - METRO - BUS - COACH - RAIL - HIGHSPEED_RAIL - LONG_DISTANCE - NIGHT_RAIL - REGIONAL_FAST_RAIL - REGIONAL_RAIL - OTHER VertexType: type: string description: | - `NORMAL` - latitude / longitude coordinate or address - `BIKESHARE` - bike sharing station - `TRANSIT` - transit stop enum: - NORMAL - BIKESHARE - TRANSIT Place: type: object required: - name - lat - lon - level properties: name: description: name of the transit stop / PoI / address type: string stopId: description: The ID of the stop. This is often something that users don't care about. type: string lat: description: latitude type: number lon: description: longitude type: number level: description: level according to OpenStreetMap type: number arrival: description: arrival time type: string format: date-time departure: description: departure time type: string format: date-time scheduledArrival: description: scheduled arrival time type: string format: date-time scheduledDeparture: description: scheduled departure time type: string format: date-time scheduledTrack: description: scheduled track from the static schedule timetable dataset type: string track: description: | The current track/platform information, updated with real-time updates if available. Can be missing if neither real-time updates nor the schedule timetable contains track information. type: string vertexType: $ref: '#/components/schemas/VertexType' StopTime: description: departure or arrival event at a stop type: object required: - place - mode - realTime - headsign - agencyId - agencyName - agencyUrl - tripId - routeShortName - source properties: place: $ref: '#/components/schemas/Place' description: information about the stop place and time mode: $ref: '#/components/schemas/Mode' description: Transport mode for this leg realTime: description: Whether there is real-time data about this leg type: boolean headsign: description: | For transit legs, the headsign of the bus or train being used. For non-transit legs, null type: string agencyId: type: string agencyName: type: string agencyUrl: type: string routeColor: type: string routeTextColor: type: string tripId: type: string routeShortName: type: string source: description: Filename and line number where this trip is from type: string TripInfo: description: trip id and name type: object required: - tripId - routeShortName properties: tripId: description: trip ID (dataset trip id prefixed with the dataset tag) type: string routeShortName: description: trip display name type: string TripSegment: description: trip segment between two stops to show a trip on a map type: object required: - trips - mode - distance - from - to - departure - arrival - scheduledArrival - scheduledDeparture - realTime - polyline properties: trips: type: array items: $ref: '#/components/schemas/TripInfo' routeColor: type: string mode: $ref: '#/components/schemas/Mode' description: Transport mode for this leg distance: type: number description: distance in meters from: $ref: '#/components/schemas/Place' to: $ref: '#/components/schemas/Place' departure: description: departure time type: string format: date-time arrival: description: arrival time type: string format: date-time scheduledDeparture: description: scheduled departure time type: string format: date-time scheduledArrival: description: scheduled arrival time type: string format: date-time realTime: description: Whether there is real-time data about this leg type: boolean polyline: description: Google polyline encoded coordinate sequence (with precision 7) where the trip travels on this segment. type: string Direction: type: string enum: - DEPART - HARD_LEFT - LEFT - SLIGHTLY_LEFT - CONTINUE - SLIGHTLY_RIGHT - RIGHT - HARD_RIGHT - CIRCLE_CLOCKWISE - CIRCLE_COUNTERCLOCKWISE - STAIRS - ELEVATOR - UTURN_LEFT - UTURN_RIGHT EncodedPolyline: type: object required: - points - length properties: points: description: The encoded points of the polyline using the Google polyline encoding with precision 7. type: string length: description: The number of points in the string type: integer StepInstruction: type: object required: - fromLevel - toLevel - polyline - relativeDirection - distance - streetName - exit - stayOn - area properties: relativeDirection: $ref: '#/components/schemas/Direction' distance: description: The distance in meters that this step takes. type: number fromLevel: description: level where this segment starts, based on OpenStreetMap data type: number toLevel: description: level where this segment starts, based on OpenStreetMap data type: number osmWay: description: OpenStreetMap way index type: integer polyline: $ref: '#/components/schemas/EncodedPolyline' streetName: description: The name of the street. type: string exit: description: | Not implemented! When exiting a highway or traffic circle, the exit name/number. type: string stayOn: description: | Not implemented! Indicates whether or not a street changes direction at an intersection. type: boolean area: description: | Not implemented! This step is on an open area, such as a plaza or train platform, and thus the directions should say something like "cross" type: boolean RentalFormFactor: type: string enum: - BICYCLE - CARGO_BICYCLE - CAR - MOPED - SCOOTER_STANDING - SCOOTER_SEATED - OTHER RentalPropulsionType: type: string enum: - HUMAN - ELECTRIC_ASSIST - ELECTRIC - COMBUSTION - COMBUSTION_DIESEL - HYBRID - PLUG_IN_HYBRID - HYDROGEN_FUEL_CELL RentalReturnConstraint: type: string enum: - NONE - ANY_STATION - ROUNDTRIP_STATION Rental: description: Vehicle rental type: object required: - systemId properties: systemId: type: string description: Vehicle share system ID systemName: type: string description: Vehicle share system name url: type: string description: URL of the vehicle share system stationName: type: string description: Name of the station rentalUriAndroid: type: string description: Rental URI for Android (deep link to the specific station or vehicle) rentalUriIOS: type: string description: Rental URI for iOS (deep link to the specific station or vehicle) rentalUriWeb: type: string description: Rental URI for web (deep link to the specific station or vehicle) formFactor: $ref: '#/components/schemas/RentalFormFactor' propulsionType: $ref: '#/components/schemas/RentalPropulsionType' returnConstraint: $ref: '#/components/schemas/RentalReturnConstraint' Leg: type: object required: - mode - startTime - endTime - scheduledStartTime - scheduledEndTime - realTime - duration - from - to - legGeometry properties: mode: $ref: '#/components/schemas/Mode' description: Transport mode for this leg from: $ref: '#/components/schemas/Place' to: $ref: '#/components/schemas/Place' duration: description: | Leg duration in seconds If leg is footpath: The footpath duration is derived from the default footpath duration using the query parameters `transferTimeFactor` and `additionalTransferTime` as follows: `leg.duration = defaultDuration * transferTimeFactor + additionalTransferTime.` In case the defaultDuration is needed, it can be calculated by `defaultDuration = (leg.duration - additionalTransferTime) / transferTimeFactor`. Note that the default values are `transferTimeFactor = 1` and `additionalTransferTime = 0` in case they are not explicitly provided in the query. type: integer startTime: type: string format: date-time description: leg departure time endTime: type: string format: date-time description: leg arrival time scheduledStartTime: type: string format: date-time description: scheduled leg departure time scheduledEndTime: type: string format: date-time description: scheduled leg arrival time realTime: description: Whether there is real-time data about this leg type: boolean distance: description: For non-transit legs the distance traveled while traversing this leg in meters. type: number interlineWithPreviousLeg: description: For transit legs, if the rider should stay on the vehicle as it changes route names. type: boolean headsign: description: | For transit legs, the headsign of the bus or train being used. For non-transit legs, null type: string routeColor: type: string routeTextColor: type: string routeType: type: string agencyName: type: string agencyUrl: type: string agencyId: type: string tripId: type: string routeShortName: type: string source: description: Filename and line number where this trip is from type: string intermediateStops: description: | For transit legs, intermediate stops between the Place where the leg originates and the Place where the leg ends. For non-transit legs, null. type: array items: $ref: "#/components/schemas/Place" legGeometry: $ref: '#/components/schemas/EncodedPolyline' steps: description: | A series of turn by turn instructions used for walking, biking and driving. type: array items: $ref: '#/components/schemas/StepInstruction' rental: $ref: '#/components/schemas/Rental' Itinerary: type: object required: - duration - startTime - endTime - transfers - legs properties: duration: description: journey duration in seconds type: integer startTime: type: string format: date-time description: journey departure time endTime: type: string format: date-time description: journey arrival time transfers: type: integer description: The number of transfers this trip has. legs: description: Journey legs type: array items: $ref: '#/components/schemas/Leg' Footpath: description: footpath from one location to another type: object required: - to properties: to: $ref: '#/components/schemas/Place' default: type: number description: | optional; missing if the GTFS did not contain a footpath footpath duration in minutes according to GTFS (+heuristics) foot: type: number description: | optional; missing if no path was found (timetable / osr) footpath duration in minutes for the foot profile footRouted: type: number description: | optional; missing if no path was found with foot routing footpath duration in minutes for the foot profile wheelchair: type: number description: | optional; missing if no path was found with the wheelchair profile footpath duration in minutes for the wheelchair profile wheelchairUsesElevator: type: boolean description: | optional; missing if no path was found with the wheelchair profile true if the wheelchair path uses an elevator motis-openapi-sdk-1.0.0/rustfmt.toml000064400000000000000000000000361046102023000155650ustar 00000000000000disable_all_formatting = true motis-openapi-sdk-1.0.0/src/apis/configuration.rs000064400000000000000000000022131046102023000201230ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ #[derive(Debug, Clone)] pub struct Configuration { pub base_path: String, pub user_agent: Option, pub client: reqwest::Client, pub basic_auth: Option, pub oauth_access_token: Option, pub bearer_access_token: Option, pub api_key: Option, } pub type BasicAuth = (String, Option); #[derive(Debug, Clone)] pub struct ApiKey { pub prefix: Option, pub key: String, } impl Configuration { pub fn new() -> Configuration { Configuration::default() } } impl Default for Configuration { fn default() -> Self { Configuration { base_path: "https://europe.motis-project.de".to_owned(), user_agent: Some("OpenAPI-Generator/v1/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, oauth_access_token: None, bearer_access_token: None, api_key: None, } } } motis-openapi-sdk-1.0.0/src/apis/debug_api.rs000064400000000000000000000036511046102023000172020ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use reqwest; use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for typed errors of method [`footpaths`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum FootpathsError { UnknownValue(serde_json::Value), } pub async fn footpaths(configuration: &configuration::Configuration, id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/debug/footpaths", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } motis-openapi-sdk-1.0.0/src/apis/geocode_api.rs000064400000000000000000000142341046102023000175200ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use reqwest; use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for typed errors of method [`geocode`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GeocodeError { UnknownValue(serde_json::Value), } /// struct for typed errors of method [`one_to_many`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum OneToManyError { UnknownValue(serde_json::Value), } /// struct for typed errors of method [`reverse_geocode`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum ReverseGeocodeError { UnknownValue(serde_json::Value), } pub async fn geocode(configuration: &configuration::Configuration, text: &str, language: Option<&str>) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/geocode", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("text", &text.to_string())]); if let Some(ref local_var_str) = language { local_var_req_builder = local_var_req_builder.query(&[("language", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } pub async fn one_to_many(configuration: &configuration::Configuration, one: &str, many: Vec, mode: models::Mode, max: f64, max_matching_distance: f64, arrive_by: bool) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/one-to-many", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("one", &one.to_string())]); local_var_req_builder = match "multi" { "multi" => local_var_req_builder.query(&many.into_iter().map(|p| ("many".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("many", &many.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; local_var_req_builder = local_var_req_builder.query(&[("mode", &mode.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("max", &max.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("maxMatchingDistance", &max_matching_distance.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("arriveBy", &arrive_by.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } pub async fn reverse_geocode(configuration: &configuration::Configuration, place: &str) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/reverse-geocode", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("place", &place.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } motis-openapi-sdk-1.0.0/src/apis/map_api.rs000064400000000000000000000162421046102023000166710ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use reqwest; use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for typed errors of method [`initial`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum InitialError { UnknownValue(serde_json::Value), } /// struct for typed errors of method [`levels`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum LevelsError { UnknownValue(serde_json::Value), } /// struct for typed errors of method [`stops`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum StopsError { UnknownValue(serde_json::Value), } /// struct for typed errors of method [`trips`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum TripsError { UnknownValue(serde_json::Value), } pub async fn initial(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/map/initial", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } pub async fn levels(configuration: &configuration::Configuration, min: &str, max: &str) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/map/levels", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("min", &min.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("max", &max.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } pub async fn stops(configuration: &configuration::Configuration, min: &str, max: &str) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/map/stops", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("min", &min.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("max", &max.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } pub async fn trips(configuration: &configuration::Configuration, zoom: f64, min: &str, max: &str, start_time: String, end_time: String) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/map/trips", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("zoom", &zoom.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("min", &min.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("max", &max.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("startTime", &start_time.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("endTime", &end_time.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } motis-openapi-sdk-1.0.0/src/apis/mod.rs000064400000000000000000000054301046102023000160370ustar 00000000000000use std::error; use std::fmt; #[derive(Debug, Clone)] pub struct ResponseContent { pub status: reqwest::StatusCode, pub content: String, pub entity: Option, } #[derive(Debug)] pub enum Error { Reqwest(reqwest::Error), Serde(serde_json::Error), Io(std::io::Error), ResponseError(ResponseContent), } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let (module, e) = match self { Error::Reqwest(e) => ("reqwest", e.to_string()), Error::Serde(e) => ("serde", e.to_string()), Error::Io(e) => ("IO", e.to_string()), Error::ResponseError(e) => ("response", format!("status code {}", e.status)), }; write!(f, "error in {}: {}", module, e) } } impl error::Error for Error { fn source(&self) -> Option<&(dyn error::Error + 'static)> { Some(match self { Error::Reqwest(e) => e, Error::Serde(e) => e, Error::Io(e) => e, Error::ResponseError(_) => return None, }) } } impl From for Error { fn from(e: reqwest::Error) -> Self { Error::Reqwest(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { Error::Serde(e) } } impl From for Error { fn from(e: std::io::Error) -> Self { Error::Io(e) } } pub fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { if let serde_json::Value::Object(object) = value { let mut params = vec![]; for (key, value) in object { match value { serde_json::Value::Object(_) => params.append(&mut parse_deep_object( &format!("{}[{}]", prefix, key), value, )), serde_json::Value::Array(array) => { for (i, value) in array.iter().enumerate() { params.append(&mut parse_deep_object( &format!("{}[{}][{}]", prefix, key, i), value, )); } }, serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), } } return params; } unimplemented!("Only objects are supported with style=deepObject") } pub mod debug_api; pub mod geocode_api; pub mod map_api; pub mod routing_api; pub mod timetable_api; pub mod configuration; motis-openapi-sdk-1.0.0/src/apis/routing_api.rs000064400000000000000000000342261046102023000176050ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use reqwest; use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for typed errors of method [`plan`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum PlanError { UnknownValue(serde_json::Value), } pub async fn plan(configuration: &configuration::Configuration, from_place: &str, to_place: &str, detailed_transfers: bool, via: Option>, via_minimum_stay: Option>, time: Option, max_transfers: Option, max_travel_time: Option, min_transfer_time: Option, additional_transfer_time: Option, transfer_time_factor: Option, max_matching_distance: Option, pedestrian_profile: Option, use_routed_transfers: Option, transit_modes: Option>, direct_modes: Option>, pre_transit_modes: Option>, post_transit_modes: Option>, direct_rental_form_factors: Option>, pre_transit_rental_form_factors: Option>, post_transit_rental_form_factors: Option>, direct_rental_propulsion_types: Option>, pre_transit_rental_propulsion_types: Option>, post_transit_rental_propulsion_types: Option>, direct_rental_providers: Option>, pre_transit_rental_providers: Option>, post_transit_rental_providers: Option>, num_itineraries: Option, page_cursor: Option<&str>, timetable_view: Option, arrive_by: Option, search_window: Option, require_bike_transport: Option, max_pre_transit_time: Option, max_post_transit_time: Option, max_direct_time: Option, timeout: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/plan", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("fromPlace", &from_place.to_string())]); local_var_req_builder = local_var_req_builder.query(&[("toPlace", &to_place.to_string())]); if let Some(ref local_var_str) = via { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("via".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("via", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = via_minimum_stay { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("viaMinimumStay".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("viaMinimumStay", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = time { local_var_req_builder = local_var_req_builder.query(&[("time", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_transfers { local_var_req_builder = local_var_req_builder.query(&[("maxTransfers", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_travel_time { local_var_req_builder = local_var_req_builder.query(&[("maxTravelTime", &local_var_str.to_string())]); } if let Some(ref local_var_str) = min_transfer_time { local_var_req_builder = local_var_req_builder.query(&[("minTransferTime", &local_var_str.to_string())]); } if let Some(ref local_var_str) = additional_transfer_time { local_var_req_builder = local_var_req_builder.query(&[("additionalTransferTime", &local_var_str.to_string())]); } if let Some(ref local_var_str) = transfer_time_factor { local_var_req_builder = local_var_req_builder.query(&[("transferTimeFactor", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_matching_distance { local_var_req_builder = local_var_req_builder.query(&[("maxMatchingDistance", &local_var_str.to_string())]); } if let Some(ref local_var_str) = pedestrian_profile { local_var_req_builder = local_var_req_builder.query(&[("pedestrianProfile", &local_var_str.to_string())]); } if let Some(ref local_var_str) = use_routed_transfers { local_var_req_builder = local_var_req_builder.query(&[("useRoutedTransfers", &local_var_str.to_string())]); } local_var_req_builder = local_var_req_builder.query(&[("detailedTransfers", &detailed_transfers.to_string())]); if let Some(ref local_var_str) = transit_modes { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("transitModes".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("transitModes", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = direct_modes { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("directModes".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("directModes", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = pre_transit_modes { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("preTransitModes".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("preTransitModes", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = post_transit_modes { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("postTransitModes".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("postTransitModes", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = direct_rental_form_factors { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("directRentalFormFactors".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("directRentalFormFactors", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = pre_transit_rental_form_factors { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("preTransitRentalFormFactors".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("preTransitRentalFormFactors", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = post_transit_rental_form_factors { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("postTransitRentalFormFactors".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("postTransitRentalFormFactors", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = direct_rental_propulsion_types { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("directRentalPropulsionTypes".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("directRentalPropulsionTypes", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = pre_transit_rental_propulsion_types { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("preTransitRentalPropulsionTypes".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("preTransitRentalPropulsionTypes", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = post_transit_rental_propulsion_types { local_var_req_builder = match "csv" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("postTransitRentalPropulsionTypes".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("postTransitRentalPropulsionTypes", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = direct_rental_providers { local_var_req_builder = match "multi" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("directRentalProviders".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("directRentalProviders", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = pre_transit_rental_providers { local_var_req_builder = match "multi" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("preTransitRentalProviders".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("preTransitRentalProviders", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = post_transit_rental_providers { local_var_req_builder = match "multi" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("postTransitRentalProviders".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("postTransitRentalProviders", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } if let Some(ref local_var_str) = num_itineraries { local_var_req_builder = local_var_req_builder.query(&[("numItineraries", &local_var_str.to_string())]); } if let Some(ref local_var_str) = page_cursor { local_var_req_builder = local_var_req_builder.query(&[("pageCursor", &local_var_str.to_string())]); } if let Some(ref local_var_str) = timetable_view { local_var_req_builder = local_var_req_builder.query(&[("timetableView", &local_var_str.to_string())]); } if let Some(ref local_var_str) = arrive_by { local_var_req_builder = local_var_req_builder.query(&[("arriveBy", &local_var_str.to_string())]); } if let Some(ref local_var_str) = search_window { local_var_req_builder = local_var_req_builder.query(&[("searchWindow", &local_var_str.to_string())]); } if let Some(ref local_var_str) = require_bike_transport { local_var_req_builder = local_var_req_builder.query(&[("requireBikeTransport", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_pre_transit_time { local_var_req_builder = local_var_req_builder.query(&[("maxPreTransitTime", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_post_transit_time { local_var_req_builder = local_var_req_builder.query(&[("maxPostTransitTime", &local_var_str.to_string())]); } if let Some(ref local_var_str) = max_direct_time { local_var_req_builder = local_var_req_builder.query(&[("maxDirectTime", &local_var_str.to_string())]); } if let Some(ref local_var_str) = timeout { local_var_req_builder = local_var_req_builder.query(&[("timeout", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } motis-openapi-sdk-1.0.0/src/apis/timetable_api.rs000064400000000000000000000117261046102023000200640ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use reqwest; use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for typed errors of method [`stoptimes`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum StoptimesError { UnknownValue(serde_json::Value), } /// struct for typed errors of method [`trip`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum TripError { UnknownValue(serde_json::Value), } pub async fn stoptimes(configuration: &configuration::Configuration, stop_id: &str, n: i32, time: Option, arrive_by: Option, direction: Option<&str>, mode: Option>, radius: Option, page_cursor: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/stoptimes", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("stopId", &stop_id.to_string())]); if let Some(ref local_var_str) = time { local_var_req_builder = local_var_req_builder.query(&[("time", &local_var_str.to_string())]); } if let Some(ref local_var_str) = arrive_by { local_var_req_builder = local_var_req_builder.query(&[("arriveBy", &local_var_str.to_string())]); } if let Some(ref local_var_str) = direction { local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]); } if let Some(ref local_var_str) = mode { local_var_req_builder = match "multi" { "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("mode".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("mode", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; } local_var_req_builder = local_var_req_builder.query(&[("n", &n.to_string())]); if let Some(ref local_var_str) = radius { local_var_req_builder = local_var_req_builder.query(&[("radius", &local_var_str.to_string())]); } if let Some(ref local_var_str) = page_cursor { local_var_req_builder = local_var_req_builder.query(&[("pageCursor", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } pub async fn trip(configuration: &configuration::Configuration, trip_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/api/v1/trip", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("tripId", &trip_id.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); let local_var_content = local_var_resp.text().await?; if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } motis-openapi-sdk-1.0.0/src/lib.rs000064400000000000000000000003451046102023000150720ustar 00000000000000#![allow(clippy::all)] #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; extern crate reqwest; pub mod apis; pub mod models; motis-openapi-sdk-1.0.0/src/models/absolute_direction.rs000064400000000000000000000025701046102023000214670ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum AbsoluteDirection { #[serde(rename = "NORTH")] North, #[serde(rename = "NORTHEAST")] Northeast, #[serde(rename = "EAST")] East, #[serde(rename = "SOUTHEAST")] Southeast, #[serde(rename = "SOUTH")] South, #[serde(rename = "SOUTHWEST")] Southwest, #[serde(rename = "WEST")] West, #[serde(rename = "NORTHWEST")] Northwest, } impl std::fmt::Display for AbsoluteDirection { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::North => write!(f, "NORTH"), Self::Northeast => write!(f, "NORTHEAST"), Self::East => write!(f, "EAST"), Self::Southeast => write!(f, "SOUTHEAST"), Self::South => write!(f, "SOUTH"), Self::Southwest => write!(f, "SOUTHWEST"), Self::West => write!(f, "WEST"), Self::Northwest => write!(f, "NORTHWEST"), } } } impl Default for AbsoluteDirection { fn default() -> AbsoluteDirection { Self::North } } motis-openapi-sdk-1.0.0/src/models/area.rs000064400000000000000000000022011046102023000165100ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// Area : Administrative area #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Area { /// Name of the area #[serde(rename = "name")] pub name: String, /// [OpenStreetMap `admin_level`](https://wiki.openstreetmap.org/wiki/Key:admin_level) of the area #[serde(rename = "adminLevel")] pub admin_level: f64, /// Whether this area was matched by the input text #[serde(rename = "matched")] pub matched: bool, /// Whether this area should be displayed as default area (area with admin level closest 7) #[serde(rename = "default", skip_serializing_if = "Option::is_none")] pub default: Option, } impl Area { /// Administrative area pub fn new(name: String, admin_level: f64, matched: bool) -> Area { Area { name, admin_level, matched, default: None, } } } motis-openapi-sdk-1.0.0/src/models/direction.rs000064400000000000000000000041131046102023000175640ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Direction { #[serde(rename = "DEPART")] Depart, #[serde(rename = "HARD_LEFT")] HardLeft, #[serde(rename = "LEFT")] Left, #[serde(rename = "SLIGHTLY_LEFT")] SlightlyLeft, #[serde(rename = "CONTINUE")] Continue, #[serde(rename = "SLIGHTLY_RIGHT")] SlightlyRight, #[serde(rename = "RIGHT")] Right, #[serde(rename = "HARD_RIGHT")] HardRight, #[serde(rename = "CIRCLE_CLOCKWISE")] CircleClockwise, #[serde(rename = "CIRCLE_COUNTERCLOCKWISE")] CircleCounterclockwise, #[serde(rename = "STAIRS")] Stairs, #[serde(rename = "ELEVATOR")] Elevator, #[serde(rename = "UTURN_LEFT")] UturnLeft, #[serde(rename = "UTURN_RIGHT")] UturnRight, } impl std::fmt::Display for Direction { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Depart => write!(f, "DEPART"), Self::HardLeft => write!(f, "HARD_LEFT"), Self::Left => write!(f, "LEFT"), Self::SlightlyLeft => write!(f, "SLIGHTLY_LEFT"), Self::Continue => write!(f, "CONTINUE"), Self::SlightlyRight => write!(f, "SLIGHTLY_RIGHT"), Self::Right => write!(f, "RIGHT"), Self::HardRight => write!(f, "HARD_RIGHT"), Self::CircleClockwise => write!(f, "CIRCLE_CLOCKWISE"), Self::CircleCounterclockwise => write!(f, "CIRCLE_COUNTERCLOCKWISE"), Self::Stairs => write!(f, "STAIRS"), Self::Elevator => write!(f, "ELEVATOR"), Self::UturnLeft => write!(f, "UTURN_LEFT"), Self::UturnRight => write!(f, "UTURN_RIGHT"), } } } impl Default for Direction { fn default() -> Direction { Self::Depart } } motis-openapi-sdk-1.0.0/src/models/duration.rs000064400000000000000000000014321046102023000174320ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// Duration : Object containing duration if a path was found or none if no path was found #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Duration { /// duration in seconds if a path was found, otherwise missing #[serde(rename = "duration", skip_serializing_if = "Option::is_none")] pub duration: Option, } impl Duration { /// Object containing duration if a path was found or none if no path was found pub fn new() -> Duration { Duration { duration: None, } } } motis-openapi-sdk-1.0.0/src/models/encoded_polyline.rs000064400000000000000000000013711046102023000211230ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EncodedPolyline { /// The encoded points of the polyline using the Google polyline encoding with precision 7. #[serde(rename = "points")] pub points: String, /// The number of points in the string #[serde(rename = "length")] pub length: i32, } impl EncodedPolyline { pub fn new(points: String, length: i32) -> EncodedPolyline { EncodedPolyline { points, length, } } } motis-openapi-sdk-1.0.0/src/models/footpath.rs000064400000000000000000000036411046102023000174350ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// Footpath : footpath from one location to another #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Footpath { #[serde(rename = "to")] pub to: Box, /// optional; missing if the GTFS did not contain a footpath footpath duration in minutes according to GTFS (+heuristics) #[serde(rename = "default", skip_serializing_if = "Option::is_none")] pub default: Option, /// optional; missing if no path was found (timetable / osr) footpath duration in minutes for the foot profile #[serde(rename = "foot", skip_serializing_if = "Option::is_none")] pub foot: Option, /// optional; missing if no path was found with foot routing footpath duration in minutes for the foot profile #[serde(rename = "footRouted", skip_serializing_if = "Option::is_none")] pub foot_routed: Option, /// optional; missing if no path was found with the wheelchair profile footpath duration in minutes for the wheelchair profile #[serde(rename = "wheelchair", skip_serializing_if = "Option::is_none")] pub wheelchair: Option, /// optional; missing if no path was found with the wheelchair profile true if the wheelchair path uses an elevator #[serde(rename = "wheelchairUsesElevator", skip_serializing_if = "Option::is_none")] pub wheelchair_uses_elevator: Option, } impl Footpath { /// footpath from one location to another pub fn new(to: models::Place) -> Footpath { Footpath { to: Box::new(to), default: None, foot: None, foot_routed: None, wheelchair: None, wheelchair_uses_elevator: None, } } } motis-openapi-sdk-1.0.0/src/models/footpaths_200_response.rs000064400000000000000000000014021046102023000221100ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Footpaths200Response { #[serde(rename = "place")] pub place: Box, /// all outgoing footpaths of this location #[serde(rename = "footpaths")] pub footpaths: Vec, } impl Footpaths200Response { pub fn new(place: models::Place, footpaths: Vec) -> Footpaths200Response { Footpaths200Response { place: Box::new(place), footpaths, } } } motis-openapi-sdk-1.0.0/src/models/initial_200_response.rs000064400000000000000000000013401046102023000215330ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Initial200Response { /// latitude #[serde(rename = "lat")] pub lat: f64, /// longitude #[serde(rename = "lon")] pub lon: f64, /// zoom level #[serde(rename = "zoom")] pub zoom: f64, } impl Initial200Response { pub fn new(lat: f64, lon: f64, zoom: f64) -> Initial200Response { Initial200Response { lat, lon, zoom, } } } motis-openapi-sdk-1.0.0/src/models/itinerary.rs000064400000000000000000000020761046102023000176200ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Itinerary { /// journey duration in seconds #[serde(rename = "duration")] pub duration: i32, /// journey departure time #[serde(rename = "startTime")] pub start_time: String, /// journey arrival time #[serde(rename = "endTime")] pub end_time: String, /// The number of transfers this trip has. #[serde(rename = "transfers")] pub transfers: i32, /// Journey legs #[serde(rename = "legs")] pub legs: Vec, } impl Itinerary { pub fn new(duration: i32, start_time: String, end_time: String, transfers: i32, legs: Vec) -> Itinerary { Itinerary { duration, start_time, end_time, transfers, legs, } } } motis-openapi-sdk-1.0.0/src/models/leg.rs000064400000000000000000000121141046102023000163530ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Leg { /// Transport mode for this leg #[serde(rename = "mode")] pub mode: models::Mode, #[serde(rename = "from")] pub from: Box, #[serde(rename = "to")] pub to: Box, /// Leg duration in seconds If leg is footpath: The footpath duration is derived from the default footpath duration using the query parameters `transferTimeFactor` and `additionalTransferTime` as follows: `leg.duration = defaultDuration * transferTimeFactor + additionalTransferTime.` In case the defaultDuration is needed, it can be calculated by `defaultDuration = (leg.duration - additionalTransferTime) / transferTimeFactor`. Note that the default values are `transferTimeFactor = 1` and `additionalTransferTime = 0` in case they are not explicitly provided in the query. #[serde(rename = "duration")] pub duration: i32, /// leg departure time #[serde(rename = "startTime")] pub start_time: String, /// leg arrival time #[serde(rename = "endTime")] pub end_time: String, /// scheduled leg departure time #[serde(rename = "scheduledStartTime")] pub scheduled_start_time: String, /// scheduled leg arrival time #[serde(rename = "scheduledEndTime")] pub scheduled_end_time: String, /// Whether there is real-time data about this leg #[serde(rename = "realTime")] pub real_time: bool, /// For non-transit legs the distance traveled while traversing this leg in meters. #[serde(rename = "distance", skip_serializing_if = "Option::is_none")] pub distance: Option, /// For transit legs, if the rider should stay on the vehicle as it changes route names. #[serde(rename = "interlineWithPreviousLeg", skip_serializing_if = "Option::is_none")] pub interline_with_previous_leg: Option, /// For transit legs, the headsign of the bus or train being used. For non-transit legs, null #[serde(rename = "headsign", skip_serializing_if = "Option::is_none")] pub headsign: Option, #[serde(rename = "routeColor", skip_serializing_if = "Option::is_none")] pub route_color: Option, #[serde(rename = "routeTextColor", skip_serializing_if = "Option::is_none")] pub route_text_color: Option, #[serde(rename = "routeType", skip_serializing_if = "Option::is_none")] pub route_type: Option, #[serde(rename = "agencyName", skip_serializing_if = "Option::is_none")] pub agency_name: Option, #[serde(rename = "agencyUrl", skip_serializing_if = "Option::is_none")] pub agency_url: Option, #[serde(rename = "agencyId", skip_serializing_if = "Option::is_none")] pub agency_id: Option, #[serde(rename = "tripId", skip_serializing_if = "Option::is_none")] pub trip_id: Option, #[serde(rename = "routeShortName", skip_serializing_if = "Option::is_none")] pub route_short_name: Option, /// Filename and line number where this trip is from #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option, /// For transit legs, intermediate stops between the Place where the leg originates and the Place where the leg ends. For non-transit legs, null. #[serde(rename = "intermediateStops", skip_serializing_if = "Option::is_none")] pub intermediate_stops: Option>, #[serde(rename = "legGeometry")] pub leg_geometry: Box, /// A series of turn by turn instructions used for walking, biking and driving. #[serde(rename = "steps", skip_serializing_if = "Option::is_none")] pub steps: Option>, #[serde(rename = "rental", skip_serializing_if = "Option::is_none")] pub rental: Option>, } impl Leg { pub fn new(mode: models::Mode, from: models::Place, to: models::Place, duration: i32, start_time: String, end_time: String, scheduled_start_time: String, scheduled_end_time: String, real_time: bool, leg_geometry: models::EncodedPolyline) -> Leg { Leg { mode, from: Box::new(from), to: Box::new(to), duration, start_time, end_time, scheduled_start_time, scheduled_end_time, real_time, distance: None, interline_with_previous_leg: None, headsign: None, route_color: None, route_text_color: None, route_type: None, agency_name: None, agency_url: None, agency_id: None, trip_id: None, route_short_name: None, source: None, intermediate_stops: None, leg_geometry: Box::new(leg_geometry), steps: None, rental: None, } } } motis-openapi-sdk-1.0.0/src/models/level_encoded_polyline.rs000064400000000000000000000021351046102023000223110ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LevelEncodedPolyline { /// level where this segment starts, based on OpenStreetMap data #[serde(rename = "fromLevel")] pub from_level: f64, /// level where this segment starts, based on OpenStreetMap data #[serde(rename = "toLevel")] pub to_level: f64, /// OpenStreetMap way index #[serde(rename = "osmWay", skip_serializing_if = "Option::is_none")] pub osm_way: Option, #[serde(rename = "polyline")] pub polyline: Box, } impl LevelEncodedPolyline { pub fn new(from_level: f64, to_level: f64, polyline: models::EncodedPolyline) -> LevelEncodedPolyline { LevelEncodedPolyline { from_level, to_level, osm_way: None, polyline: Box::new(polyline), } } } motis-openapi-sdk-1.0.0/src/models/mod.rs000064400000000000000000000030221046102023000163610ustar 00000000000000pub mod area; pub use self::area::Area; pub mod direction; pub use self::direction::Direction; pub mod duration; pub use self::duration::Duration; pub mod encoded_polyline; pub use self::encoded_polyline::EncodedPolyline; pub mod footpath; pub use self::footpath::Footpath; pub mod footpaths_200_response; pub use self::footpaths_200_response::Footpaths200Response; pub mod initial_200_response; pub use self::initial_200_response::Initial200Response; pub mod itinerary; pub use self::itinerary::Itinerary; pub mod leg; pub use self::leg::Leg; pub mod model_match; pub use self::model_match::Match; pub mod mode; pub use self::mode::Mode; pub mod pedestrian_profile; pub use self::pedestrian_profile::PedestrianProfile; pub mod place; pub use self::place::Place; pub mod plan_200_response; pub use self::plan_200_response::Plan200Response; pub mod rental; pub use self::rental::Rental; pub mod rental_form_factor; pub use self::rental_form_factor::RentalFormFactor; pub mod rental_propulsion_type; pub use self::rental_propulsion_type::RentalPropulsionType; pub mod rental_return_constraint; pub use self::rental_return_constraint::RentalReturnConstraint; pub mod step_instruction; pub use self::step_instruction::StepInstruction; pub mod stop_time; pub use self::stop_time::StopTime; pub mod stoptimes_200_response; pub use self::stoptimes_200_response::Stoptimes200Response; pub mod trip_info; pub use self::trip_info::TripInfo; pub mod trip_segment; pub use self::trip_segment::TripSegment; pub mod vertex_type; pub use self::vertex_type::VertexType; motis-openapi-sdk-1.0.0/src/models/mode.rs000064400000000000000000000103331046102023000165310ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// Mode : # Street modes - `WALK` - `BIKE` - `RENTAL` Experimental. Expect unannounced breaking changes (without version bumps). - `CAR` - `CAR_PARKING` # Transit modes - `TRANSIT`: translates to `RAIL,SUBWAY,TRAM,BUS,FERRY,AIRPLANE,COACH` - `TRAM`: trams - `SUBWAY`: subway trains - `FERRY`: ferries - `AIRPLANE`: airline flights - `BUS`: short distance buses (does not include `COACH`) - `COACH`: long distance buses (does not include `BUS`) - `RAIL`: translates to `HIGHSPEED_RAIL,LONG_DISTANCE_RAIL,NIGHT_RAIL,REGIONAL_RAIL,REGIONAL_FAST_RAIL` - `METRO`: metro trains - `HIGHSPEED_RAIL`: long distance high speed trains (e.g. TGV) - `LONG_DISTANCE`: long distance inter city trains - `NIGHT_RAIL`: long distance night trains - `REGIONAL_FAST_RAIL`: regional express routes that skip low traffic stops to be faster - `REGIONAL_RAIL`: regional train /// # Street modes - `WALK` - `BIKE` - `RENTAL` Experimental. Expect unannounced breaking changes (without version bumps). - `CAR` - `CAR_PARKING` # Transit modes - `TRANSIT`: translates to `RAIL,SUBWAY,TRAM,BUS,FERRY,AIRPLANE,COACH` - `TRAM`: trams - `SUBWAY`: subway trains - `FERRY`: ferries - `AIRPLANE`: airline flights - `BUS`: short distance buses (does not include `COACH`) - `COACH`: long distance buses (does not include `BUS`) - `RAIL`: translates to `HIGHSPEED_RAIL,LONG_DISTANCE_RAIL,NIGHT_RAIL,REGIONAL_RAIL,REGIONAL_FAST_RAIL` - `METRO`: metro trains - `HIGHSPEED_RAIL`: long distance high speed trains (e.g. TGV) - `LONG_DISTANCE`: long distance inter city trains - `NIGHT_RAIL`: long distance night trains - `REGIONAL_FAST_RAIL`: regional express routes that skip low traffic stops to be faster - `REGIONAL_RAIL`: regional train #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Mode { #[serde(rename = "WALK")] Walk, #[serde(rename = "BIKE")] Bike, #[serde(rename = "RENTAL")] Rental, #[serde(rename = "CAR")] Car, #[serde(rename = "CAR_PARKING")] CarParking, #[serde(rename = "TRANSIT")] Transit, #[serde(rename = "TRAM")] Tram, #[serde(rename = "SUBWAY")] Subway, #[serde(rename = "FERRY")] Ferry, #[serde(rename = "AIRPLANE")] Airplane, #[serde(rename = "METRO")] Metro, #[serde(rename = "BUS")] Bus, #[serde(rename = "COACH")] Coach, #[serde(rename = "RAIL")] Rail, #[serde(rename = "HIGHSPEED_RAIL")] HighspeedRail, #[serde(rename = "LONG_DISTANCE")] LongDistance, #[serde(rename = "NIGHT_RAIL")] NightRail, #[serde(rename = "REGIONAL_FAST_RAIL")] RegionalFastRail, #[serde(rename = "REGIONAL_RAIL")] RegionalRail, #[serde(rename = "OTHER")] Other, } impl std::fmt::Display for Mode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Walk => write!(f, "WALK"), Self::Bike => write!(f, "BIKE"), Self::Rental => write!(f, "RENTAL"), Self::Car => write!(f, "CAR"), Self::CarParking => write!(f, "CAR_PARKING"), Self::Transit => write!(f, "TRANSIT"), Self::Tram => write!(f, "TRAM"), Self::Subway => write!(f, "SUBWAY"), Self::Ferry => write!(f, "FERRY"), Self::Airplane => write!(f, "AIRPLANE"), Self::Metro => write!(f, "METRO"), Self::Bus => write!(f, "BUS"), Self::Coach => write!(f, "COACH"), Self::Rail => write!(f, "RAIL"), Self::HighspeedRail => write!(f, "HIGHSPEED_RAIL"), Self::LongDistance => write!(f, "LONG_DISTANCE"), Self::NightRail => write!(f, "NIGHT_RAIL"), Self::RegionalFastRail => write!(f, "REGIONAL_FAST_RAIL"), Self::RegionalRail => write!(f, "REGIONAL_RAIL"), Self::Other => write!(f, "OTHER"), } } } impl Default for Mode { fn default() -> Mode { Self::Walk } } motis-openapi-sdk-1.0.0/src/models/model_match.rs000064400000000000000000000046721046102023000200720ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// Match : GeoCoding match #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Match { /// location type #[serde(rename = "type")] pub r#type: Type, /// list of non-overlapping tokens that were matched #[serde(rename = "tokens")] pub tokens: Vec>, /// name of the location (transit stop / PoI / address) #[serde(rename = "name")] pub name: String, /// unique ID of the location #[serde(rename = "id")] pub id: String, /// latitude #[serde(rename = "lat")] pub lat: f64, /// longitude #[serde(rename = "lon")] pub lon: f64, /// level according to OpenStreetMap (at the moment only for public transport) #[serde(rename = "level", skip_serializing_if = "Option::is_none")] pub level: Option, /// street name #[serde(rename = "street", skip_serializing_if = "Option::is_none")] pub street: Option, /// house number #[serde(rename = "houseNumber", skip_serializing_if = "Option::is_none")] pub house_number: Option, /// zip code #[serde(rename = "zip", skip_serializing_if = "Option::is_none")] pub zip: Option, /// list of areas #[serde(rename = "areas")] pub areas: Vec, /// score according to the internal scoring system (the scoring algorithm might change in the future) #[serde(rename = "score")] pub score: f64, } impl Match { /// GeoCoding match pub fn new(r#type: Type, tokens: Vec>, name: String, id: String, lat: f64, lon: f64, areas: Vec, score: f64) -> Match { Match { r#type, tokens, name, id, lat, lon, level: None, street: None, house_number: None, zip: None, areas, score, } } } /// location type #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Type { #[serde(rename = "ADDRESS")] Address, #[serde(rename = "PLACE")] Place, #[serde(rename = "STOP")] Stop, } impl Default for Type { fn default() -> Type { Self::Address } } motis-openapi-sdk-1.0.0/src/models/pedestrian_profile.rs000064400000000000000000000016641046102023000214720ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// PedestrianProfile : Different accessibility profiles for pedestrians. /// Different accessibility profiles for pedestrians. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum PedestrianProfile { #[serde(rename = "FOOT")] Foot, #[serde(rename = "WHEELCHAIR")] Wheelchair, } impl std::fmt::Display for PedestrianProfile { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Foot => write!(f, "FOOT"), Self::Wheelchair => write!(f, "WHEELCHAIR"), } } } impl Default for PedestrianProfile { fn default() -> PedestrianProfile { Self::Foot } } motis-openapi-sdk-1.0.0/src/models/place.rs000064400000000000000000000046521046102023000167000ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Place { /// name of the transit stop / PoI / address #[serde(rename = "name")] pub name: String, /// The ID of the stop. This is often something that users don't care about. #[serde(rename = "stopId", skip_serializing_if = "Option::is_none")] pub stop_id: Option, /// latitude #[serde(rename = "lat")] pub lat: f64, /// longitude #[serde(rename = "lon")] pub lon: f64, /// level according to OpenStreetMap #[serde(rename = "level")] pub level: f64, /// arrival time #[serde(rename = "arrival", skip_serializing_if = "Option::is_none")] pub arrival: Option, /// departure time #[serde(rename = "departure", skip_serializing_if = "Option::is_none")] pub departure: Option, /// scheduled arrival time #[serde(rename = "scheduledArrival", skip_serializing_if = "Option::is_none")] pub scheduled_arrival: Option, /// scheduled departure time #[serde(rename = "scheduledDeparture", skip_serializing_if = "Option::is_none")] pub scheduled_departure: Option, /// scheduled track from the static schedule timetable dataset #[serde(rename = "scheduledTrack", skip_serializing_if = "Option::is_none")] pub scheduled_track: Option, /// The current track/platform information, updated with real-time updates if available. Can be missing if neither real-time updates nor the schedule timetable contains track information. #[serde(rename = "track", skip_serializing_if = "Option::is_none")] pub track: Option, #[serde(rename = "vertexType", skip_serializing_if = "Option::is_none")] pub vertex_type: Option, } impl Place { pub fn new(name: String, lat: f64, lon: f64, level: f64) -> Place { Place { name, stop_id: None, lat, lon, level, arrival: None, departure: None, scheduled_arrival: None, scheduled_departure: None, scheduled_track: None, track: None, vertex_type: None, } } } motis-openapi-sdk-1.0.0/src/models/plan_200_response.rs000064400000000000000000000047711046102023000210470ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Plan200Response { /// the routing query #[serde(rename = "requestParameters")] pub request_parameters: std::collections::HashMap, /// debug statistics #[serde(rename = "debugOutput")] pub debug_output: std::collections::HashMap, #[serde(rename = "from")] pub from: Box, #[serde(rename = "to")] pub to: Box, /// Direct trips by `WALK`, `BIKE`, `CAR`, etc. without time-dependency. The starting time (`arriveBy=false`) / arrival time (`arriveBy=true`) is always the queried `time` parameter (set to \\\"now\\\" if not set). But all `direct` connections are meant to be independent of absolute times. #[serde(rename = "direct")] pub direct: Vec, /// list of itineraries #[serde(rename = "itineraries")] pub itineraries: Vec, /// Use the cursor to get the previous page of results. Insert the cursor into the request and post it to get the previous page. The previous page is a set of itineraries departing BEFORE the first itinerary in the result for a depart after search. When using the default sort order the previous set of itineraries is inserted before the current result. #[serde(rename = "previousPageCursor")] pub previous_page_cursor: String, /// Use the cursor to get the next page of results. Insert the cursor into the request and post it to get the next page. The next page is a set of itineraries departing AFTER the last itinerary in this result. #[serde(rename = "nextPageCursor")] pub next_page_cursor: String, } impl Plan200Response { pub fn new(request_parameters: std::collections::HashMap, debug_output: std::collections::HashMap, from: models::Place, to: models::Place, direct: Vec, itineraries: Vec, previous_page_cursor: String, next_page_cursor: String) -> Plan200Response { Plan200Response { request_parameters, debug_output, from: Box::new(from), to: Box::new(to), direct, itineraries, previous_page_cursor, next_page_cursor, } } } motis-openapi-sdk-1.0.0/src/models/relative_direction.rs000064400000000000000000000040161046102023000214610ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RelativeDirection { #[serde(rename = "DEPART")] Depart, #[serde(rename = "HARD_LEFT")] HardLeft, #[serde(rename = "LEFT")] Left, #[serde(rename = "SLIGHTLY_LEFT")] SlightlyLeft, #[serde(rename = "CONTINUE")] Continue, #[serde(rename = "SLIGHTLY_RIGHT")] SlightlyRight, #[serde(rename = "RIGHT")] Right, #[serde(rename = "HARD_RIGHT")] HardRight, #[serde(rename = "CIRCLE_CLOCKWISE")] CircleClockwise, #[serde(rename = "CIRCLE_COUNTERCLOCKWISE")] CircleCounterclockwise, #[serde(rename = "ELEVATOR")] Elevator, #[serde(rename = "UTURN_LEFT")] UturnLeft, #[serde(rename = "UTURN_RIGHT")] UturnRight, } impl std::fmt::Display for RelativeDirection { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Depart => write!(f, "DEPART"), Self::HardLeft => write!(f, "HARD_LEFT"), Self::Left => write!(f, "LEFT"), Self::SlightlyLeft => write!(f, "SLIGHTLY_LEFT"), Self::Continue => write!(f, "CONTINUE"), Self::SlightlyRight => write!(f, "SLIGHTLY_RIGHT"), Self::Right => write!(f, "RIGHT"), Self::HardRight => write!(f, "HARD_RIGHT"), Self::CircleClockwise => write!(f, "CIRCLE_CLOCKWISE"), Self::CircleCounterclockwise => write!(f, "CIRCLE_COUNTERCLOCKWISE"), Self::Elevator => write!(f, "ELEVATOR"), Self::UturnLeft => write!(f, "UTURN_LEFT"), Self::UturnRight => write!(f, "UTURN_RIGHT"), } } } impl Default for RelativeDirection { fn default() -> RelativeDirection { Self::Depart } } motis-openapi-sdk-1.0.0/src/models/rental.rs000064400000000000000000000044411046102023000170750ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// Rental : Vehicle rental #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Rental { /// Vehicle share system ID #[serde(rename = "systemId")] pub system_id: String, /// Vehicle share system name #[serde(rename = "systemName", skip_serializing_if = "Option::is_none")] pub system_name: Option, /// URL of the vehicle share system #[serde(rename = "url", skip_serializing_if = "Option::is_none")] pub url: Option, /// Name of the station #[serde(rename = "stationName", skip_serializing_if = "Option::is_none")] pub station_name: Option, /// Rental URI for Android (deep link to the specific station or vehicle) #[serde(rename = "rentalUriAndroid", skip_serializing_if = "Option::is_none")] pub rental_uri_android: Option, /// Rental URI for iOS (deep link to the specific station or vehicle) #[serde(rename = "rentalUriIOS", skip_serializing_if = "Option::is_none")] pub rental_uri_ios: Option, /// Rental URI for web (deep link to the specific station or vehicle) #[serde(rename = "rentalUriWeb", skip_serializing_if = "Option::is_none")] pub rental_uri_web: Option, #[serde(rename = "formFactor", skip_serializing_if = "Option::is_none")] pub form_factor: Option, #[serde(rename = "propulsionType", skip_serializing_if = "Option::is_none")] pub propulsion_type: Option, #[serde(rename = "returnConstraint", skip_serializing_if = "Option::is_none")] pub return_constraint: Option, } impl Rental { /// Vehicle rental pub fn new(system_id: String) -> Rental { Rental { system_id, system_name: None, url: None, station_name: None, rental_uri_android: None, rental_uri_ios: None, rental_uri_web: None, form_factor: None, propulsion_type: None, return_constraint: None, } } } motis-openapi-sdk-1.0.0/src/models/rental_form_factor.rs000064400000000000000000000025171046102023000214600ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RentalFormFactor { #[serde(rename = "BICYCLE")] Bicycle, #[serde(rename = "CARGO_BICYCLE")] CargoBicycle, #[serde(rename = "CAR")] Car, #[serde(rename = "MOPED")] Moped, #[serde(rename = "SCOOTER_STANDING")] ScooterStanding, #[serde(rename = "SCOOTER_SEATED")] ScooterSeated, #[serde(rename = "OTHER")] Other, } impl std::fmt::Display for RentalFormFactor { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Bicycle => write!(f, "BICYCLE"), Self::CargoBicycle => write!(f, "CARGO_BICYCLE"), Self::Car => write!(f, "CAR"), Self::Moped => write!(f, "MOPED"), Self::ScooterStanding => write!(f, "SCOOTER_STANDING"), Self::ScooterSeated => write!(f, "SCOOTER_SEATED"), Self::Other => write!(f, "OTHER"), } } } impl Default for RentalFormFactor { fn default() -> RentalFormFactor { Self::Bicycle } } motis-openapi-sdk-1.0.0/src/models/rental_propulsion_type.rs000064400000000000000000000030241046102023000224240ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RentalPropulsionType { #[serde(rename = "HUMAN")] Human, #[serde(rename = "ELECTRIC_ASSIST")] ElectricAssist, #[serde(rename = "ELECTRIC")] Electric, #[serde(rename = "COMBUSTION")] Combustion, #[serde(rename = "COMBUSTION_DIESEL")] CombustionDiesel, #[serde(rename = "HYBRID")] Hybrid, #[serde(rename = "PLUG_IN_HYBRID")] PlugInHybrid, #[serde(rename = "HYDROGEN_FUEL_CELL")] HydrogenFuelCell, } impl std::fmt::Display for RentalPropulsionType { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Human => write!(f, "HUMAN"), Self::ElectricAssist => write!(f, "ELECTRIC_ASSIST"), Self::Electric => write!(f, "ELECTRIC"), Self::Combustion => write!(f, "COMBUSTION"), Self::CombustionDiesel => write!(f, "COMBUSTION_DIESEL"), Self::Hybrid => write!(f, "HYBRID"), Self::PlugInHybrid => write!(f, "PLUG_IN_HYBRID"), Self::HydrogenFuelCell => write!(f, "HYDROGEN_FUEL_CELL"), } } } impl Default for RentalPropulsionType { fn default() -> RentalPropulsionType { Self::Human } } motis-openapi-sdk-1.0.0/src/models/rental_return_constraint.rs000064400000000000000000000017261046102023000227430ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RentalReturnConstraint { #[serde(rename = "NONE")] None, #[serde(rename = "ANY_STATION")] AnyStation, #[serde(rename = "ROUNDTRIP_STATION")] RoundtripStation, } impl std::fmt::Display for RentalReturnConstraint { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::None => write!(f, "NONE"), Self::AnyStation => write!(f, "ANY_STATION"), Self::RoundtripStation => write!(f, "ROUNDTRIP_STATION"), } } } impl Default for RentalReturnConstraint { fn default() -> RentalReturnConstraint { Self::None } } motis-openapi-sdk-1.0.0/src/models/step_instruction.rs000064400000000000000000000041361046102023000212250ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StepInstruction { #[serde(rename = "relativeDirection")] pub relative_direction: models::Direction, /// The distance in meters that this step takes. #[serde(rename = "distance")] pub distance: f64, /// level where this segment starts, based on OpenStreetMap data #[serde(rename = "fromLevel")] pub from_level: f64, /// level where this segment starts, based on OpenStreetMap data #[serde(rename = "toLevel")] pub to_level: f64, /// OpenStreetMap way index #[serde(rename = "osmWay", skip_serializing_if = "Option::is_none")] pub osm_way: Option, #[serde(rename = "polyline")] pub polyline: Box, /// The name of the street. #[serde(rename = "streetName")] pub street_name: String, /// Not implemented! When exiting a highway or traffic circle, the exit name/number. #[serde(rename = "exit")] pub exit: String, /// Not implemented! Indicates whether or not a street changes direction at an intersection. #[serde(rename = "stayOn")] pub stay_on: bool, /// Not implemented! This step is on an open area, such as a plaza or train platform, and thus the directions should say something like \"cross\" #[serde(rename = "area")] pub area: bool, } impl StepInstruction { pub fn new(relative_direction: models::Direction, distance: f64, from_level: f64, to_level: f64, polyline: models::EncodedPolyline, street_name: String, exit: String, stay_on: bool, area: bool) -> StepInstruction { StepInstruction { relative_direction, distance, from_level, to_level, osm_way: None, polyline: Box::new(polyline), street_name, exit, stay_on, area, } } } motis-openapi-sdk-1.0.0/src/models/stop_time.rs000064400000000000000000000041731046102023000176150ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// StopTime : departure or arrival event at a stop #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StopTime { /// information about the stop place and time #[serde(rename = "place")] pub place: Box, /// Transport mode for this leg #[serde(rename = "mode")] pub mode: models::Mode, /// Whether there is real-time data about this leg #[serde(rename = "realTime")] pub real_time: bool, /// For transit legs, the headsign of the bus or train being used. For non-transit legs, null #[serde(rename = "headsign")] pub headsign: String, #[serde(rename = "agencyId")] pub agency_id: String, #[serde(rename = "agencyName")] pub agency_name: String, #[serde(rename = "agencyUrl")] pub agency_url: String, #[serde(rename = "routeColor", skip_serializing_if = "Option::is_none")] pub route_color: Option, #[serde(rename = "routeTextColor", skip_serializing_if = "Option::is_none")] pub route_text_color: Option, #[serde(rename = "tripId")] pub trip_id: String, #[serde(rename = "routeShortName")] pub route_short_name: String, /// Filename and line number where this trip is from #[serde(rename = "source")] pub source: String, } impl StopTime { /// departure or arrival event at a stop pub fn new(place: models::Place, mode: models::Mode, real_time: bool, headsign: String, agency_id: String, agency_name: String, agency_url: String, trip_id: String, route_short_name: String, source: String) -> StopTime { StopTime { place: Box::new(place), mode, real_time, headsign, agency_id, agency_name, agency_url, route_color: None, route_text_color: None, trip_id, route_short_name, source, } } } motis-openapi-sdk-1.0.0/src/models/stoptimes_200_response.rs000064400000000000000000000024551046102023000221410ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Stoptimes200Response { /// list of stop times #[serde(rename = "stopTimes")] pub stop_times: Vec, /// Use the cursor to get the previous page of results. Insert the cursor into the request and post it to get the previous page. The previous page is a set of stop times BEFORE the first stop time in the result. #[serde(rename = "previousPageCursor")] pub previous_page_cursor: String, /// Use the cursor to get the next page of results. Insert the cursor into the request and post it to get the next page. The next page is a set of stop times AFTER the last stop time in this result. #[serde(rename = "nextPageCursor")] pub next_page_cursor: String, } impl Stoptimes200Response { pub fn new(stop_times: Vec, previous_page_cursor: String, next_page_cursor: String) -> Stoptimes200Response { Stoptimes200Response { stop_times, previous_page_cursor, next_page_cursor, } } } motis-openapi-sdk-1.0.0/src/models/trip_info.rs000064400000000000000000000014241046102023000175770ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// TripInfo : trip id and name #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TripInfo { /// trip ID (dataset trip id prefixed with the dataset tag) #[serde(rename = "tripId")] pub trip_id: String, /// trip display name #[serde(rename = "routeShortName")] pub route_short_name: String, } impl TripInfo { /// trip id and name pub fn new(trip_id: String, route_short_name: String) -> TripInfo { TripInfo { trip_id, route_short_name, } } } motis-openapi-sdk-1.0.0/src/models/trip_segment.rs000064400000000000000000000043231046102023000203070ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// TripSegment : trip segment between two stops to show a trip on a map #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TripSegment { #[serde(rename = "trips")] pub trips: Vec, #[serde(rename = "routeColor", skip_serializing_if = "Option::is_none")] pub route_color: Option, /// Transport mode for this leg #[serde(rename = "mode")] pub mode: models::Mode, /// distance in meters #[serde(rename = "distance")] pub distance: f64, #[serde(rename = "from")] pub from: Box, #[serde(rename = "to")] pub to: Box, /// departure time #[serde(rename = "departure")] pub departure: String, /// arrival time #[serde(rename = "arrival")] pub arrival: String, /// scheduled departure time #[serde(rename = "scheduledDeparture")] pub scheduled_departure: String, /// scheduled arrival time #[serde(rename = "scheduledArrival")] pub scheduled_arrival: String, /// Whether there is real-time data about this leg #[serde(rename = "realTime")] pub real_time: bool, /// Google polyline encoded coordinate sequence (with precision 7) where the trip travels on this segment. #[serde(rename = "polyline")] pub polyline: String, } impl TripSegment { /// trip segment between two stops to show a trip on a map pub fn new(trips: Vec, mode: models::Mode, distance: f64, from: models::Place, to: models::Place, departure: String, arrival: String, scheduled_departure: String, scheduled_arrival: String, real_time: bool, polyline: String) -> TripSegment { TripSegment { trips, route_color: None, mode, distance, from: Box::new(from), to: Box::new(to), departure, arrival, scheduled_departure, scheduled_arrival, real_time, polyline, } } } motis-openapi-sdk-1.0.0/src/models/vertex_type.rs000064400000000000000000000022061046102023000201630ustar 00000000000000/* * MOTIS API * * This is the MOTIS routing API. * * The version of the OpenAPI document: v1 * Contact: felix@triptix.tech * Generated by: https://openapi-generator.tech */ use crate::models; use serde::{Deserialize, Serialize}; /// VertexType : - `NORMAL` - latitude / longitude coordinate or address - `BIKESHARE` - bike sharing station - `TRANSIT` - transit stop /// - `NORMAL` - latitude / longitude coordinate or address - `BIKESHARE` - bike sharing station - `TRANSIT` - transit stop #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum VertexType { #[serde(rename = "NORMAL")] Normal, #[serde(rename = "BIKESHARE")] Bikeshare, #[serde(rename = "TRANSIT")] Transit, } impl std::fmt::Display for VertexType { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Self::Normal => write!(f, "NORMAL"), Self::Bikeshare => write!(f, "BIKESHARE"), Self::Transit => write!(f, "TRANSIT"), } } } impl Default for VertexType { fn default() -> VertexType { Self::Normal } }