onebusaway-sdk 0.1.0.pre.alpha.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +124 -0
- data/lib/onebusaway-sdk/base_client.rb +483 -0
- data/lib/onebusaway-sdk/base_model.rb +1188 -0
- data/lib/onebusaway-sdk/base_page.rb +40 -0
- data/lib/onebusaway-sdk/client.rb +181 -0
- data/lib/onebusaway-sdk/errors.rb +187 -0
- data/lib/onebusaway-sdk/extern.rb +10 -0
- data/lib/onebusaway-sdk/models/agencies_with_coverage_list_params.rb +18 -0
- data/lib/onebusaway-sdk/models/agencies_with_coverage_list_response.rb +84 -0
- data/lib/onebusaway-sdk/models/agency_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/agency_retrieve_response.rb +151 -0
- data/lib/onebusaway-sdk/models/arrival_and_departure_list_params.rb +51 -0
- data/lib/onebusaway-sdk/models/arrival_and_departure_list_response.rb +767 -0
- data/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_params.rb +60 -0
- data/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_response.rb +751 -0
- data/lib/onebusaway-sdk/models/block_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/block_retrieve_response.rb +205 -0
- data/lib/onebusaway-sdk/models/config_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/config_retrieve_response.rb +331 -0
- data/lib/onebusaway-sdk/models/current_time_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/current_time_retrieve_response.rb +67 -0
- data/lib/onebusaway-sdk/models/references.rb +1071 -0
- data/lib/onebusaway-sdk/models/report_problem_with_stop_retrieve_params.rb +117 -0
- data/lib/onebusaway-sdk/models/report_problem_with_trip_retrieve_params.rb +180 -0
- data/lib/onebusaway-sdk/models/response_wrapper.rb +37 -0
- data/lib/onebusaway-sdk/models/route_ids_for_agency_list_params.rb +18 -0
- data/lib/onebusaway-sdk/models/route_ids_for_agency_list_response.rb +45 -0
- data/lib/onebusaway-sdk/models/route_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/route_retrieve_response.rb +149 -0
- data/lib/onebusaway-sdk/models/routes_for_agency_list_params.rb +18 -0
- data/lib/onebusaway-sdk/models/routes_for_agency_list_response.rb +156 -0
- data/lib/onebusaway-sdk/models/routes_for_location_list_params.rb +70 -0
- data/lib/onebusaway-sdk/models/routes_for_location_list_response.rb +162 -0
- data/lib/onebusaway-sdk/models/schedule_for_route_retrieve_params.rb +30 -0
- data/lib/onebusaway-sdk/models/schedule_for_route_retrieve_response.rb +453 -0
- data/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_params.rb +30 -0
- data/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_response.rb +244 -0
- data/lib/onebusaway-sdk/models/search_for_route_list_params.rb +36 -0
- data/lib/onebusaway-sdk/models/search_for_route_list_response.rb +166 -0
- data/lib/onebusaway-sdk/models/search_for_stop_list_params.rb +36 -0
- data/lib/onebusaway-sdk/models/search_for_stop_list_response.rb +161 -0
- data/lib/onebusaway-sdk/models/shape_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/shape_retrieve_response.rb +70 -0
- data/lib/onebusaway-sdk/models/stop_ids_for_agency_list_params.rb +18 -0
- data/lib/onebusaway-sdk/models/stop_ids_for_agency_list_response.rb +45 -0
- data/lib/onebusaway-sdk/models/stop_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/stop_retrieve_response.rb +144 -0
- data/lib/onebusaway-sdk/models/stops_for_agency_list_params.rb +18 -0
- data/lib/onebusaway-sdk/models/stops_for_agency_list_response.rb +146 -0
- data/lib/onebusaway-sdk/models/stops_for_location_list_params.rb +74 -0
- data/lib/onebusaway-sdk/models/stops_for_location_list_response.rb +161 -0
- data/lib/onebusaway-sdk/models/stops_for_route_list_params.rb +40 -0
- data/lib/onebusaway-sdk/models/stops_for_route_list_response.rb +253 -0
- data/lib/onebusaway-sdk/models/trip_detail_retrieve_params.rb +86 -0
- data/lib/onebusaway-sdk/models/trip_detail_retrieve_response.rb +561 -0
- data/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_params.rb +65 -0
- data/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_response.rb +561 -0
- data/lib/onebusaway-sdk/models/trip_retrieve_params.rb +18 -0
- data/lib/onebusaway-sdk/models/trip_retrieve_response.rb +160 -0
- data/lib/onebusaway-sdk/models/trips_for_location_list_params.rb +93 -0
- data/lib/onebusaway-sdk/models/trips_for_location_list_response.rb +572 -0
- data/lib/onebusaway-sdk/models/trips_for_route_list_params.rb +52 -0
- data/lib/onebusaway-sdk/models/trips_for_route_list_response.rb +559 -0
- data/lib/onebusaway-sdk/models/vehicles_for_agency_list_params.rb +29 -0
- data/lib/onebusaway-sdk/models/vehicles_for_agency_list_response.rb +529 -0
- data/lib/onebusaway-sdk/pooled_net_requester.rb +170 -0
- data/lib/onebusaway-sdk/request_options.rb +115 -0
- data/lib/onebusaway-sdk/resources/agencies_with_coverage.rb +31 -0
- data/lib/onebusaway-sdk/resources/agency.rb +32 -0
- data/lib/onebusaway-sdk/resources/arrival_and_departure.rb +71 -0
- data/lib/onebusaway-sdk/resources/block.rb +32 -0
- data/lib/onebusaway-sdk/resources/config.rb +30 -0
- data/lib/onebusaway-sdk/resources/current_time.rb +30 -0
- data/lib/onebusaway-sdk/resources/report_problem_with_stop.rb +44 -0
- data/lib/onebusaway-sdk/resources/report_problem_with_trip.rb +54 -0
- data/lib/onebusaway-sdk/resources/route.rb +32 -0
- data/lib/onebusaway-sdk/resources/route_ids_for_agency.rb +32 -0
- data/lib/onebusaway-sdk/resources/routes_for_agency.rb +32 -0
- data/lib/onebusaway-sdk/resources/routes_for_location.rb +44 -0
- data/lib/onebusaway-sdk/resources/schedule_for_route.rb +37 -0
- data/lib/onebusaway-sdk/resources/schedule_for_stop.rb +37 -0
- data/lib/onebusaway-sdk/resources/search_for_route.rb +36 -0
- data/lib/onebusaway-sdk/resources/search_for_stop.rb +36 -0
- data/lib/onebusaway-sdk/resources/shape.rb +32 -0
- data/lib/onebusaway-sdk/resources/stop.rb +32 -0
- data/lib/onebusaway-sdk/resources/stop_ids_for_agency.rb +32 -0
- data/lib/onebusaway-sdk/resources/stops_for_agency.rb +32 -0
- data/lib/onebusaway-sdk/resources/stops_for_location.rb +44 -0
- data/lib/onebusaway-sdk/resources/stops_for_route.rb +38 -0
- data/lib/onebusaway-sdk/resources/trip.rb +32 -0
- data/lib/onebusaway-sdk/resources/trip_details.rb +47 -0
- data/lib/onebusaway-sdk/resources/trip_for_vehicle.rb +45 -0
- data/lib/onebusaway-sdk/resources/trips_for_location.rb +48 -0
- data/lib/onebusaway-sdk/resources/trips_for_route.rb +41 -0
- data/lib/onebusaway-sdk/resources/vehicles_for_agency.rb +36 -0
- data/lib/onebusaway-sdk/util.rb +512 -0
- data/lib/onebusaway-sdk/version.rb +5 -0
- data/lib/onebusaway-sdk.rb +116 -0
- data/manifest.yaml +13 -0
- data/rbi/lib/onebusaway-sdk/base_client.rbi +162 -0
- data/rbi/lib/onebusaway-sdk/base_model.rbi +478 -0
- data/rbi/lib/onebusaway-sdk/base_page.rbi +39 -0
- data/rbi/lib/onebusaway-sdk/client.rbi +154 -0
- data/rbi/lib/onebusaway-sdk/errors.rbi +145 -0
- data/rbi/lib/onebusaway-sdk/extern.rbi +7 -0
- data/rbi/lib/onebusaway-sdk/models/agencies_with_coverage_list_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/agencies_with_coverage_list_response.rbi +131 -0
- data/rbi/lib/onebusaway-sdk/models/agency_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/agency_retrieve_response.rbi +210 -0
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_list_params.rbi +60 -0
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_list_response.rbi +914 -0
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_params.rbi +87 -0
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_response.rbi +857 -0
- data/rbi/lib/onebusaway-sdk/models/block_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/block_retrieve_response.rbi +383 -0
- data/rbi/lib/onebusaway-sdk/models/config_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/config_retrieve_response.rbi +389 -0
- data/rbi/lib/onebusaway-sdk/models/current_time_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/current_time_retrieve_response.rbi +95 -0
- data/rbi/lib/onebusaway-sdk/models/references.rbi +1265 -0
- data/rbi/lib/onebusaway-sdk/models/report_problem_with_stop_retrieve_params.rbi +101 -0
- data/rbi/lib/onebusaway-sdk/models/report_problem_with_trip_retrieve_params.rbi +157 -0
- data/rbi/lib/onebusaway-sdk/models/response_wrapper.rbi +47 -0
- data/rbi/lib/onebusaway-sdk/models/route_ids_for_agency_list_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/route_ids_for_agency_list_response.rbi +68 -0
- data/rbi/lib/onebusaway-sdk/models/route_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/route_retrieve_response.rbi +200 -0
- data/rbi/lib/onebusaway-sdk/models/routes_for_agency_list_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/routes_for_agency_list_response.rbi +210 -0
- data/rbi/lib/onebusaway-sdk/models/routes_for_location_list_params.rbi +90 -0
- data/rbi/lib/onebusaway-sdk/models/routes_for_location_list_response.rbi +220 -0
- data/rbi/lib/onebusaway-sdk/models/schedule_for_route_retrieve_params.rbi +34 -0
- data/rbi/lib/onebusaway-sdk/models/schedule_for_route_retrieve_response.rbi +675 -0
- data/rbi/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_params.rbi +34 -0
- data/rbi/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_response.rbi +457 -0
- data/rbi/lib/onebusaway-sdk/models/search_for_route_list_params.rbi +43 -0
- data/rbi/lib/onebusaway-sdk/models/search_for_route_list_response.rbi +220 -0
- data/rbi/lib/onebusaway-sdk/models/search_for_stop_list_params.rbi +43 -0
- data/rbi/lib/onebusaway-sdk/models/search_for_stop_list_response.rbi +231 -0
- data/rbi/lib/onebusaway-sdk/models/shape_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/shape_retrieve_response.rbi +103 -0
- data/rbi/lib/onebusaway-sdk/models/stop_ids_for_agency_list_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/stop_ids_for_agency_list_response.rbi +68 -0
- data/rbi/lib/onebusaway-sdk/models/stop_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/stop_retrieve_response.rbi +211 -0
- data/rbi/lib/onebusaway-sdk/models/stops_for_agency_list_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/stops_for_agency_list_response.rbi +210 -0
- data/rbi/lib/onebusaway-sdk/models/stops_for_location_list_params.rbi +90 -0
- data/rbi/lib/onebusaway-sdk/models/stops_for_location_list_response.rbi +231 -0
- data/rbi/lib/onebusaway-sdk/models/stops_for_route_list_params.rbi +48 -0
- data/rbi/lib/onebusaway-sdk/models/stops_for_route_list_response.rbi +307 -0
- data/rbi/lib/onebusaway-sdk/models/trip_detail_retrieve_params.rbi +87 -0
- data/rbi/lib/onebusaway-sdk/models/trip_detail_retrieve_response.rbi +702 -0
- data/rbi/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_params.rbi +76 -0
- data/rbi/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_response.rbi +704 -0
- data/rbi/lib/onebusaway-sdk/models/trip_retrieve_params.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/models/trip_retrieve_response.rbi +211 -0
- data/rbi/lib/onebusaway-sdk/models/trips_for_location_list_params.rbi +109 -0
- data/rbi/lib/onebusaway-sdk/models/trips_for_location_list_response.rbi +715 -0
- data/rbi/lib/onebusaway-sdk/models/trips_for_route_list_params.rbi +60 -0
- data/rbi/lib/onebusaway-sdk/models/trips_for_route_list_response.rbi +705 -0
- data/rbi/lib/onebusaway-sdk/models/vehicles_for_agency_list_params.rbi +35 -0
- data/rbi/lib/onebusaway-sdk/models/vehicles_for_agency_list_response.rbi +633 -0
- data/rbi/lib/onebusaway-sdk/pooled_net_requester.rbi +36 -0
- data/rbi/lib/onebusaway-sdk/request_options.rbi +84 -0
- data/rbi/lib/onebusaway-sdk/resources/agencies_with_coverage.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/resources/agency.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/arrival_and_departure.rbi +47 -0
- data/rbi/lib/onebusaway-sdk/resources/block.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/config.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/resources/current_time.rbi +18 -0
- data/rbi/lib/onebusaway-sdk/resources/report_problem_with_stop.rbi +34 -0
- data/rbi/lib/onebusaway-sdk/resources/report_problem_with_trip.rbi +44 -0
- data/rbi/lib/onebusaway-sdk/resources/route.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/route_ids_for_agency.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/routes_for_agency.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/routes_for_location.rbi +26 -0
- data/rbi/lib/onebusaway-sdk/resources/schedule_for_route.rbi +22 -0
- data/rbi/lib/onebusaway-sdk/resources/schedule_for_stop.rbi +22 -0
- data/rbi/lib/onebusaway-sdk/resources/search_for_route.rbi +22 -0
- data/rbi/lib/onebusaway-sdk/resources/search_for_stop.rbi +22 -0
- data/rbi/lib/onebusaway-sdk/resources/shape.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/stop.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/stop_ids_for_agency.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/stops_for_agency.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/stops_for_location.rbi +26 -0
- data/rbi/lib/onebusaway-sdk/resources/stops_for_route.rbi +23 -0
- data/rbi/lib/onebusaway-sdk/resources/trip.rbi +21 -0
- data/rbi/lib/onebusaway-sdk/resources/trip_details.rbi +34 -0
- data/rbi/lib/onebusaway-sdk/resources/trip_for_vehicle.rbi +32 -0
- data/rbi/lib/onebusaway-sdk/resources/trips_for_location.rbi +36 -0
- data/rbi/lib/onebusaway-sdk/resources/trips_for_route.rbi +24 -0
- data/rbi/lib/onebusaway-sdk/resources/vehicles_for_agency.rbi +22 -0
- data/rbi/lib/onebusaway-sdk/util.rbi +136 -0
- data/rbi/lib/onebusaway-sdk/version.rbi +5 -0
- data/sig/onebusaway-sdk/base_client.rbs +101 -0
- data/sig/onebusaway-sdk/base_model.rbs +244 -0
- data/sig/onebusaway-sdk/base_page.rbs +20 -0
- data/sig/onebusaway-sdk/client.rbs +80 -0
- data/sig/onebusaway-sdk/errors.rbs +98 -0
- data/sig/onebusaway-sdk/extern.rbs +4 -0
- data/sig/onebusaway-sdk/models/agencies_with_coverage_list_params.rbs +20 -0
- data/sig/onebusaway-sdk/models/agencies_with_coverage_list_response.rbs +85 -0
- data/sig/onebusaway-sdk/models/agency_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/agency_retrieve_response.rbs +115 -0
- data/sig/onebusaway-sdk/models/arrival_and_departure_list_params.rbs +38 -0
- data/sig/onebusaway-sdk/models/arrival_and_departure_list_response.rbs +447 -0
- data/sig/onebusaway-sdk/models/arrival_and_departure_retrieve_params.rbs +50 -0
- data/sig/onebusaway-sdk/models/arrival_and_departure_retrieve_response.rbs +427 -0
- data/sig/onebusaway-sdk/models/block_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/block_retrieve_response.rbs +201 -0
- data/sig/onebusaway-sdk/models/config_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/config_retrieve_response.rbs +227 -0
- data/sig/onebusaway-sdk/models/current_time_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/current_time_retrieve_response.rbs +64 -0
- data/sig/onebusaway-sdk/models/references.rbs +732 -0
- data/sig/onebusaway-sdk/models/report_problem_with_stop_retrieve_params.rbs +73 -0
- data/sig/onebusaway-sdk/models/report_problem_with_trip_retrieve_params.rbs +105 -0
- data/sig/onebusaway-sdk/models/response_wrapper.rbs +30 -0
- data/sig/onebusaway-sdk/models/route_ids_for_agency_list_params.rbs +20 -0
- data/sig/onebusaway-sdk/models/route_ids_for_agency_list_response.rbs +49 -0
- data/sig/onebusaway-sdk/models/route_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/route_retrieve_response.rbs +113 -0
- data/sig/onebusaway-sdk/models/routes_for_agency_list_params.rbs +20 -0
- data/sig/onebusaway-sdk/models/routes_for_agency_list_response.rbs +117 -0
- data/sig/onebusaway-sdk/models/routes_for_location_list_params.rbs +56 -0
- data/sig/onebusaway-sdk/models/routes_for_location_list_response.rbs +123 -0
- data/sig/onebusaway-sdk/models/schedule_for_route_retrieve_params.rbs +24 -0
- data/sig/onebusaway-sdk/models/schedule_for_route_retrieve_response.rbs +341 -0
- data/sig/onebusaway-sdk/models/schedule_for_stop_retrieve_params.rbs +24 -0
- data/sig/onebusaway-sdk/models/schedule_for_stop_retrieve_response.rbs +215 -0
- data/sig/onebusaway-sdk/models/search_for_route_list_params.rbs +30 -0
- data/sig/onebusaway-sdk/models/search_for_route_list_response.rbs +125 -0
- data/sig/onebusaway-sdk/models/search_for_stop_list_params.rbs +30 -0
- data/sig/onebusaway-sdk/models/search_for_stop_list_response.rbs +123 -0
- data/sig/onebusaway-sdk/models/shape_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/shape_retrieve_response.rbs +64 -0
- data/sig/onebusaway-sdk/models/stop_ids_for_agency_list_params.rbs +20 -0
- data/sig/onebusaway-sdk/models/stop_ids_for_agency_list_response.rbs +49 -0
- data/sig/onebusaway-sdk/models/stop_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/stop_retrieve_response.rbs +111 -0
- data/sig/onebusaway-sdk/models/stops_for_agency_list_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/stops_for_agency_list_response.rbs +105 -0
- data/sig/onebusaway-sdk/models/stops_for_location_list_params.rbs +56 -0
- data/sig/onebusaway-sdk/models/stops_for_location_list_response.rbs +123 -0
- data/sig/onebusaway-sdk/models/stops_for_route_list_params.rbs +33 -0
- data/sig/onebusaway-sdk/models/stops_for_route_list_response.rbs +206 -0
- data/sig/onebusaway-sdk/models/trip_detail_retrieve_params.rbs +54 -0
- data/sig/onebusaway-sdk/models/trip_detail_retrieve_response.rbs +375 -0
- data/sig/onebusaway-sdk/models/trip_for_vehicle_retrieve_params.rbs +48 -0
- data/sig/onebusaway-sdk/models/trip_for_vehicle_retrieve_response.rbs +377 -0
- data/sig/onebusaway-sdk/models/trip_retrieve_params.rbs +19 -0
- data/sig/onebusaway-sdk/models/trip_retrieve_response.rbs +119 -0
- data/sig/onebusaway-sdk/models/trips_for_location_list_params.rbs +58 -0
- data/sig/onebusaway-sdk/models/trips_for_location_list_response.rbs +379 -0
- data/sig/onebusaway-sdk/models/trips_for_route_list_params.rbs +38 -0
- data/sig/onebusaway-sdk/models/trips_for_route_list_response.rbs +371 -0
- data/sig/onebusaway-sdk/models/vehicles_for_agency_list_params.rbs +24 -0
- data/sig/onebusaway-sdk/models/vehicles_for_agency_list_response.rbs +332 -0
- data/sig/onebusaway-sdk/pooled_net_requester.rbs +28 -0
- data/sig/onebusaway-sdk/request_options.rbs +42 -0
- data/sig/onebusaway-sdk/resources/agencies_with_coverage.rbs +16 -0
- data/sig/onebusaway-sdk/resources/agency.rbs +18 -0
- data/sig/onebusaway-sdk/resources/arrival_and_departure.rbs +37 -0
- data/sig/onebusaway-sdk/resources/block.rbs +18 -0
- data/sig/onebusaway-sdk/resources/config.rbs +16 -0
- data/sig/onebusaway-sdk/resources/current_time.rbs +16 -0
- data/sig/onebusaway-sdk/resources/report_problem_with_stop.rbs +23 -0
- data/sig/onebusaway-sdk/resources/report_problem_with_trip.rbs +28 -0
- data/sig/onebusaway-sdk/resources/route.rbs +18 -0
- data/sig/onebusaway-sdk/resources/route_ids_for_agency.rbs +18 -0
- data/sig/onebusaway-sdk/resources/routes_for_agency.rbs +18 -0
- data/sig/onebusaway-sdk/resources/routes_for_location.rbs +22 -0
- data/sig/onebusaway-sdk/resources/schedule_for_route.rbs +19 -0
- data/sig/onebusaway-sdk/resources/schedule_for_stop.rbs +19 -0
- data/sig/onebusaway-sdk/resources/search_for_route.rbs +18 -0
- data/sig/onebusaway-sdk/resources/search_for_stop.rbs +18 -0
- data/sig/onebusaway-sdk/resources/shape.rbs +18 -0
- data/sig/onebusaway-sdk/resources/stop.rbs +18 -0
- data/sig/onebusaway-sdk/resources/stop_ids_for_agency.rbs +18 -0
- data/sig/onebusaway-sdk/resources/stops_for_agency.rbs +18 -0
- data/sig/onebusaway-sdk/resources/stops_for_location.rbs +22 -0
- data/sig/onebusaway-sdk/resources/stops_for_route.rbs +20 -0
- data/sig/onebusaway-sdk/resources/trip.rbs +18 -0
- data/sig/onebusaway-sdk/resources/trip_details.rbs +23 -0
- data/sig/onebusaway-sdk/resources/trip_for_vehicle.rbs +22 -0
- data/sig/onebusaway-sdk/resources/trips_for_location.rbs +23 -0
- data/sig/onebusaway-sdk/resources/trips_for_route.rbs +21 -0
- data/sig/onebusaway-sdk/resources/vehicles_for_agency.rbs +19 -0
- data/sig/onebusaway-sdk/util.rbs +90 -0
- data/sig/onebusaway-sdk/version.rbs +3 -0
- metadata +350 -0
@@ -0,0 +1,529 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OnebusawaySDK
|
4
|
+
module Models
|
5
|
+
class VehiclesForAgencyListResponse < OnebusawaySDK::Models::ResponseWrapper
|
6
|
+
# @!attribute data
|
7
|
+
#
|
8
|
+
# @return [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data]
|
9
|
+
required :data, -> { OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data }
|
10
|
+
|
11
|
+
# @!parse
|
12
|
+
# # @param data [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data]
|
13
|
+
# #
|
14
|
+
# def initialize(data:, **) = super
|
15
|
+
|
16
|
+
# def initialize: (Hash | OnebusawaySDK::BaseModel) -> void
|
17
|
+
|
18
|
+
class Data < OnebusawaySDK::BaseModel
|
19
|
+
# @!attribute limit_exceeded
|
20
|
+
#
|
21
|
+
# @return [Boolean]
|
22
|
+
required :limit_exceeded, OnebusawaySDK::BooleanModel, api_name: :limitExceeded
|
23
|
+
|
24
|
+
# @!attribute list
|
25
|
+
#
|
26
|
+
# @return [Array<OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List>]
|
27
|
+
required :list,
|
28
|
+
-> { OnebusawaySDK::ArrayOf[OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List] }
|
29
|
+
|
30
|
+
# @!attribute references
|
31
|
+
#
|
32
|
+
# @return [OnebusawaySDK::Models::References]
|
33
|
+
required :references, -> { OnebusawaySDK::Models::References }
|
34
|
+
|
35
|
+
# @!parse
|
36
|
+
# # @param limit_exceeded [Boolean]
|
37
|
+
# # @param list [Array<OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List>]
|
38
|
+
# # @param references [OnebusawaySDK::Models::References]
|
39
|
+
# #
|
40
|
+
# def initialize(limit_exceeded:, list:, references:, **) = super
|
41
|
+
|
42
|
+
# def initialize: (Hash | OnebusawaySDK::BaseModel) -> void
|
43
|
+
|
44
|
+
class List < OnebusawaySDK::BaseModel
|
45
|
+
# @!attribute last_location_update_time
|
46
|
+
#
|
47
|
+
# @return [Integer]
|
48
|
+
required :last_location_update_time, Integer, api_name: :lastLocationUpdateTime
|
49
|
+
|
50
|
+
# @!attribute last_update_time
|
51
|
+
#
|
52
|
+
# @return [Integer]
|
53
|
+
required :last_update_time, Integer, api_name: :lastUpdateTime
|
54
|
+
|
55
|
+
# @!attribute location
|
56
|
+
#
|
57
|
+
# @return [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::Location]
|
58
|
+
required :location, -> { OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::Location }
|
59
|
+
|
60
|
+
# @!attribute trip_id
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
required :trip_id, String, api_name: :tripId
|
64
|
+
|
65
|
+
# @!attribute trip_status
|
66
|
+
#
|
67
|
+
# @return [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus]
|
68
|
+
required :trip_status,
|
69
|
+
-> { OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus },
|
70
|
+
api_name: :tripStatus
|
71
|
+
|
72
|
+
# @!attribute vehicle_id
|
73
|
+
#
|
74
|
+
# @return [String]
|
75
|
+
required :vehicle_id, String, api_name: :vehicleId
|
76
|
+
|
77
|
+
# @!attribute [r] occupancy_capacity
|
78
|
+
#
|
79
|
+
# @return [Integer, nil]
|
80
|
+
optional :occupancy_capacity, Integer, api_name: :occupancyCapacity
|
81
|
+
|
82
|
+
# @!parse
|
83
|
+
# # @return [Integer]
|
84
|
+
# attr_writer :occupancy_capacity
|
85
|
+
|
86
|
+
# @!attribute [r] occupancy_count
|
87
|
+
#
|
88
|
+
# @return [Integer, nil]
|
89
|
+
optional :occupancy_count, Integer, api_name: :occupancyCount
|
90
|
+
|
91
|
+
# @!parse
|
92
|
+
# # @return [Integer]
|
93
|
+
# attr_writer :occupancy_count
|
94
|
+
|
95
|
+
# @!attribute [r] occupancy_status
|
96
|
+
#
|
97
|
+
# @return [String, nil]
|
98
|
+
optional :occupancy_status, String, api_name: :occupancyStatus
|
99
|
+
|
100
|
+
# @!parse
|
101
|
+
# # @return [String]
|
102
|
+
# attr_writer :occupancy_status
|
103
|
+
|
104
|
+
# @!attribute [r] phase
|
105
|
+
#
|
106
|
+
# @return [String, nil]
|
107
|
+
optional :phase, String
|
108
|
+
|
109
|
+
# @!parse
|
110
|
+
# # @return [String]
|
111
|
+
# attr_writer :phase
|
112
|
+
|
113
|
+
# @!attribute [r] status
|
114
|
+
#
|
115
|
+
# @return [String, nil]
|
116
|
+
optional :status, String
|
117
|
+
|
118
|
+
# @!parse
|
119
|
+
# # @return [String]
|
120
|
+
# attr_writer :status
|
121
|
+
|
122
|
+
# @!parse
|
123
|
+
# # @param last_location_update_time [Integer]
|
124
|
+
# # @param last_update_time [Integer]
|
125
|
+
# # @param location [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::Location]
|
126
|
+
# # @param trip_id [String]
|
127
|
+
# # @param trip_status [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus]
|
128
|
+
# # @param vehicle_id [String]
|
129
|
+
# # @param occupancy_capacity [Integer]
|
130
|
+
# # @param occupancy_count [Integer]
|
131
|
+
# # @param occupancy_status [String]
|
132
|
+
# # @param phase [String]
|
133
|
+
# # @param status [String]
|
134
|
+
# #
|
135
|
+
# def initialize(
|
136
|
+
# last_location_update_time:,
|
137
|
+
# last_update_time:,
|
138
|
+
# location:,
|
139
|
+
# trip_id:,
|
140
|
+
# trip_status:,
|
141
|
+
# vehicle_id:,
|
142
|
+
# occupancy_capacity: nil,
|
143
|
+
# occupancy_count: nil,
|
144
|
+
# occupancy_status: nil,
|
145
|
+
# phase: nil,
|
146
|
+
# status: nil,
|
147
|
+
# **
|
148
|
+
# )
|
149
|
+
# super
|
150
|
+
# end
|
151
|
+
|
152
|
+
# def initialize: (Hash | OnebusawaySDK::BaseModel) -> void
|
153
|
+
|
154
|
+
class Location < OnebusawaySDK::BaseModel
|
155
|
+
# @!attribute [r] lat
|
156
|
+
#
|
157
|
+
# @return [Float, nil]
|
158
|
+
optional :lat, Float
|
159
|
+
|
160
|
+
# @!parse
|
161
|
+
# # @return [Float]
|
162
|
+
# attr_writer :lat
|
163
|
+
|
164
|
+
# @!attribute [r] lon
|
165
|
+
#
|
166
|
+
# @return [Float, nil]
|
167
|
+
optional :lon, Float
|
168
|
+
|
169
|
+
# @!parse
|
170
|
+
# # @return [Float]
|
171
|
+
# attr_writer :lon
|
172
|
+
|
173
|
+
# @!parse
|
174
|
+
# # @param lat [Float]
|
175
|
+
# # @param lon [Float]
|
176
|
+
# #
|
177
|
+
# def initialize(lat: nil, lon: nil, **) = super
|
178
|
+
|
179
|
+
# def initialize: (Hash | OnebusawaySDK::BaseModel) -> void
|
180
|
+
end
|
181
|
+
|
182
|
+
class TripStatus < OnebusawaySDK::BaseModel
|
183
|
+
# @!attribute active_trip_id
|
184
|
+
# Trip ID of the trip the vehicle is actively serving.
|
185
|
+
#
|
186
|
+
# @return [String]
|
187
|
+
required :active_trip_id, String, api_name: :activeTripId
|
188
|
+
|
189
|
+
# @!attribute block_trip_sequence
|
190
|
+
# Index of the active trip into the sequence of trips for the active block.
|
191
|
+
#
|
192
|
+
# @return [Integer]
|
193
|
+
required :block_trip_sequence, Integer, api_name: :blockTripSequence
|
194
|
+
|
195
|
+
# @!attribute closest_stop
|
196
|
+
# ID of the closest stop to the current location of the transit vehicle.
|
197
|
+
#
|
198
|
+
# @return [String]
|
199
|
+
required :closest_stop, String, api_name: :closestStop
|
200
|
+
|
201
|
+
# @!attribute distance_along_trip
|
202
|
+
# Distance, in meters, the transit vehicle has progressed along the active trip.
|
203
|
+
#
|
204
|
+
# @return [Float]
|
205
|
+
required :distance_along_trip, Float, api_name: :distanceAlongTrip
|
206
|
+
|
207
|
+
# @!attribute last_known_distance_along_trip
|
208
|
+
# Last known distance along the trip received in real-time from the transit
|
209
|
+
# vehicle.
|
210
|
+
#
|
211
|
+
# @return [Float]
|
212
|
+
required :last_known_distance_along_trip, Float, api_name: :lastKnownDistanceAlongTrip
|
213
|
+
|
214
|
+
# @!attribute last_location_update_time
|
215
|
+
# Timestamp of the last known real-time location update from the transit vehicle.
|
216
|
+
#
|
217
|
+
# @return [Integer]
|
218
|
+
required :last_location_update_time, Integer, api_name: :lastLocationUpdateTime
|
219
|
+
|
220
|
+
# @!attribute last_update_time
|
221
|
+
# Timestamp of the last known real-time update from the transit vehicle.
|
222
|
+
#
|
223
|
+
# @return [Integer]
|
224
|
+
required :last_update_time, Integer, api_name: :lastUpdateTime
|
225
|
+
|
226
|
+
# @!attribute occupancy_capacity
|
227
|
+
# Capacity of the transit vehicle in terms of occupancy.
|
228
|
+
#
|
229
|
+
# @return [Integer]
|
230
|
+
required :occupancy_capacity, Integer, api_name: :occupancyCapacity
|
231
|
+
|
232
|
+
# @!attribute occupancy_count
|
233
|
+
# Current count of occupants in the transit vehicle.
|
234
|
+
#
|
235
|
+
# @return [Integer]
|
236
|
+
required :occupancy_count, Integer, api_name: :occupancyCount
|
237
|
+
|
238
|
+
# @!attribute occupancy_status
|
239
|
+
# Current occupancy status of the transit vehicle.
|
240
|
+
#
|
241
|
+
# @return [String]
|
242
|
+
required :occupancy_status, String, api_name: :occupancyStatus
|
243
|
+
|
244
|
+
# @!attribute phase
|
245
|
+
# Current journey phase of the trip.
|
246
|
+
#
|
247
|
+
# @return [String]
|
248
|
+
required :phase, String
|
249
|
+
|
250
|
+
# @!attribute predicted
|
251
|
+
# Indicates if real-time arrival info is available for this trip.
|
252
|
+
#
|
253
|
+
# @return [Boolean]
|
254
|
+
required :predicted, OnebusawaySDK::BooleanModel
|
255
|
+
|
256
|
+
# @!attribute schedule_deviation
|
257
|
+
# Deviation from the schedule in seconds (positive for late, negative for early).
|
258
|
+
#
|
259
|
+
# @return [Integer]
|
260
|
+
required :schedule_deviation, Integer, api_name: :scheduleDeviation
|
261
|
+
|
262
|
+
# @!attribute service_date
|
263
|
+
# Time, in milliseconds since the Unix epoch, of midnight for the start of the
|
264
|
+
# service date for the trip.
|
265
|
+
#
|
266
|
+
# @return [Integer]
|
267
|
+
required :service_date, Integer, api_name: :serviceDate
|
268
|
+
|
269
|
+
# @!attribute status
|
270
|
+
# Current status modifiers for the trip.
|
271
|
+
#
|
272
|
+
# @return [String]
|
273
|
+
required :status, String
|
274
|
+
|
275
|
+
# @!attribute total_distance_along_trip
|
276
|
+
# Total length of the trip, in meters.
|
277
|
+
#
|
278
|
+
# @return [Float]
|
279
|
+
required :total_distance_along_trip, Float, api_name: :totalDistanceAlongTrip
|
280
|
+
|
281
|
+
# @!attribute [r] closest_stop_time_offset
|
282
|
+
# Time offset from the closest stop to the current position of the transit vehicle
|
283
|
+
# (in seconds).
|
284
|
+
#
|
285
|
+
# @return [Integer, nil]
|
286
|
+
optional :closest_stop_time_offset, Integer, api_name: :closestStopTimeOffset
|
287
|
+
|
288
|
+
# @!parse
|
289
|
+
# # @return [Integer]
|
290
|
+
# attr_writer :closest_stop_time_offset
|
291
|
+
|
292
|
+
# @!attribute [r] frequency
|
293
|
+
# Information about frequency-based scheduling, if applicable to the trip.
|
294
|
+
#
|
295
|
+
# @return [String, nil]
|
296
|
+
optional :frequency, String
|
297
|
+
|
298
|
+
# @!parse
|
299
|
+
# # @return [String]
|
300
|
+
# attr_writer :frequency
|
301
|
+
|
302
|
+
# @!attribute [r] last_known_location
|
303
|
+
# Last known location of the transit vehicle.
|
304
|
+
#
|
305
|
+
# @return [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::LastKnownLocation, nil]
|
306
|
+
optional :last_known_location,
|
307
|
+
-> { OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::LastKnownLocation },
|
308
|
+
api_name: :lastKnownLocation
|
309
|
+
|
310
|
+
# @!parse
|
311
|
+
# # @return [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::LastKnownLocation]
|
312
|
+
# attr_writer :last_known_location
|
313
|
+
|
314
|
+
# @!attribute [r] last_known_orientation
|
315
|
+
# Last known orientation value received in real-time from the transit vehicle.
|
316
|
+
#
|
317
|
+
# @return [Float, nil]
|
318
|
+
optional :last_known_orientation, Float, api_name: :lastKnownOrientation
|
319
|
+
|
320
|
+
# @!parse
|
321
|
+
# # @return [Float]
|
322
|
+
# attr_writer :last_known_orientation
|
323
|
+
|
324
|
+
# @!attribute [r] next_stop
|
325
|
+
# ID of the next stop the transit vehicle is scheduled to arrive at.
|
326
|
+
#
|
327
|
+
# @return [String, nil]
|
328
|
+
optional :next_stop, String, api_name: :nextStop
|
329
|
+
|
330
|
+
# @!parse
|
331
|
+
# # @return [String]
|
332
|
+
# attr_writer :next_stop
|
333
|
+
|
334
|
+
# @!attribute [r] next_stop_time_offset
|
335
|
+
# Time offset from the next stop to the current position of the transit vehicle
|
336
|
+
# (in seconds).
|
337
|
+
#
|
338
|
+
# @return [Integer, nil]
|
339
|
+
optional :next_stop_time_offset, Integer, api_name: :nextStopTimeOffset
|
340
|
+
|
341
|
+
# @!parse
|
342
|
+
# # @return [Integer]
|
343
|
+
# attr_writer :next_stop_time_offset
|
344
|
+
|
345
|
+
# @!attribute [r] orientation
|
346
|
+
# Orientation of the transit vehicle, represented as an angle in degrees.
|
347
|
+
#
|
348
|
+
# @return [Float, nil]
|
349
|
+
optional :orientation, Float
|
350
|
+
|
351
|
+
# @!parse
|
352
|
+
# # @return [Float]
|
353
|
+
# attr_writer :orientation
|
354
|
+
|
355
|
+
# @!attribute [r] position
|
356
|
+
# Current position of the transit vehicle.
|
357
|
+
#
|
358
|
+
# @return [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::Position, nil]
|
359
|
+
optional :position,
|
360
|
+
-> { OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::Position }
|
361
|
+
|
362
|
+
# @!parse
|
363
|
+
# # @return [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::Position]
|
364
|
+
# attr_writer :position
|
365
|
+
|
366
|
+
# @!attribute [r] scheduled_distance_along_trip
|
367
|
+
# Distance, in meters, the transit vehicle is scheduled to have progressed along
|
368
|
+
# the active trip.
|
369
|
+
#
|
370
|
+
# @return [Float, nil]
|
371
|
+
optional :scheduled_distance_along_trip, Float, api_name: :scheduledDistanceAlongTrip
|
372
|
+
|
373
|
+
# @!parse
|
374
|
+
# # @return [Float]
|
375
|
+
# attr_writer :scheduled_distance_along_trip
|
376
|
+
|
377
|
+
# @!attribute [r] situation_ids
|
378
|
+
# References to situation elements (if any) applicable to this trip.
|
379
|
+
#
|
380
|
+
# @return [Array<String>, nil]
|
381
|
+
optional :situation_ids, OnebusawaySDK::ArrayOf[String], api_name: :situationIds
|
382
|
+
|
383
|
+
# @!parse
|
384
|
+
# # @return [Array<String>]
|
385
|
+
# attr_writer :situation_ids
|
386
|
+
|
387
|
+
# @!attribute [r] vehicle_id
|
388
|
+
# ID of the transit vehicle currently serving the trip.
|
389
|
+
#
|
390
|
+
# @return [String, nil]
|
391
|
+
optional :vehicle_id, String, api_name: :vehicleId
|
392
|
+
|
393
|
+
# @!parse
|
394
|
+
# # @return [String]
|
395
|
+
# attr_writer :vehicle_id
|
396
|
+
|
397
|
+
# @!parse
|
398
|
+
# # @param active_trip_id [String]
|
399
|
+
# # @param block_trip_sequence [Integer]
|
400
|
+
# # @param closest_stop [String]
|
401
|
+
# # @param distance_along_trip [Float]
|
402
|
+
# # @param last_known_distance_along_trip [Float]
|
403
|
+
# # @param last_location_update_time [Integer]
|
404
|
+
# # @param last_update_time [Integer]
|
405
|
+
# # @param occupancy_capacity [Integer]
|
406
|
+
# # @param occupancy_count [Integer]
|
407
|
+
# # @param occupancy_status [String]
|
408
|
+
# # @param phase [String]
|
409
|
+
# # @param predicted [Boolean]
|
410
|
+
# # @param schedule_deviation [Integer]
|
411
|
+
# # @param service_date [Integer]
|
412
|
+
# # @param status [String]
|
413
|
+
# # @param total_distance_along_trip [Float]
|
414
|
+
# # @param closest_stop_time_offset [Integer]
|
415
|
+
# # @param frequency [String]
|
416
|
+
# # @param last_known_location [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::LastKnownLocation]
|
417
|
+
# # @param last_known_orientation [Float]
|
418
|
+
# # @param next_stop [String]
|
419
|
+
# # @param next_stop_time_offset [Integer]
|
420
|
+
# # @param orientation [Float]
|
421
|
+
# # @param position [OnebusawaySDK::Models::VehiclesForAgencyListResponse::Data::List::TripStatus::Position]
|
422
|
+
# # @param scheduled_distance_along_trip [Float]
|
423
|
+
# # @param situation_ids [Array<String>]
|
424
|
+
# # @param vehicle_id [String]
|
425
|
+
# #
|
426
|
+
# def initialize(
|
427
|
+
# active_trip_id:,
|
428
|
+
# block_trip_sequence:,
|
429
|
+
# closest_stop:,
|
430
|
+
# distance_along_trip:,
|
431
|
+
# last_known_distance_along_trip:,
|
432
|
+
# last_location_update_time:,
|
433
|
+
# last_update_time:,
|
434
|
+
# occupancy_capacity:,
|
435
|
+
# occupancy_count:,
|
436
|
+
# occupancy_status:,
|
437
|
+
# phase:,
|
438
|
+
# predicted:,
|
439
|
+
# schedule_deviation:,
|
440
|
+
# service_date:,
|
441
|
+
# status:,
|
442
|
+
# total_distance_along_trip:,
|
443
|
+
# closest_stop_time_offset: nil,
|
444
|
+
# frequency: nil,
|
445
|
+
# last_known_location: nil,
|
446
|
+
# last_known_orientation: nil,
|
447
|
+
# next_stop: nil,
|
448
|
+
# next_stop_time_offset: nil,
|
449
|
+
# orientation: nil,
|
450
|
+
# position: nil,
|
451
|
+
# scheduled_distance_along_trip: nil,
|
452
|
+
# situation_ids: nil,
|
453
|
+
# vehicle_id: nil,
|
454
|
+
# **
|
455
|
+
# )
|
456
|
+
# super
|
457
|
+
# end
|
458
|
+
|
459
|
+
# def initialize: (Hash | OnebusawaySDK::BaseModel) -> void
|
460
|
+
|
461
|
+
class LastKnownLocation < OnebusawaySDK::BaseModel
|
462
|
+
# @!attribute [r] lat
|
463
|
+
# Latitude of the last known location of the transit vehicle.
|
464
|
+
#
|
465
|
+
# @return [Float, nil]
|
466
|
+
optional :lat, Float
|
467
|
+
|
468
|
+
# @!parse
|
469
|
+
# # @return [Float]
|
470
|
+
# attr_writer :lat
|
471
|
+
|
472
|
+
# @!attribute [r] lon
|
473
|
+
# Longitude of the last known location of the transit vehicle.
|
474
|
+
#
|
475
|
+
# @return [Float, nil]
|
476
|
+
optional :lon, Float
|
477
|
+
|
478
|
+
# @!parse
|
479
|
+
# # @return [Float]
|
480
|
+
# attr_writer :lon
|
481
|
+
|
482
|
+
# @!parse
|
483
|
+
# # Last known location of the transit vehicle.
|
484
|
+
# #
|
485
|
+
# # @param lat [Float]
|
486
|
+
# # @param lon [Float]
|
487
|
+
# #
|
488
|
+
# def initialize(lat: nil, lon: nil, **) = super
|
489
|
+
|
490
|
+
# def initialize: (Hash | OnebusawaySDK::BaseModel) -> void
|
491
|
+
end
|
492
|
+
|
493
|
+
class Position < OnebusawaySDK::BaseModel
|
494
|
+
# @!attribute [r] lat
|
495
|
+
# Latitude of the current position of the transit vehicle.
|
496
|
+
#
|
497
|
+
# @return [Float, nil]
|
498
|
+
optional :lat, Float
|
499
|
+
|
500
|
+
# @!parse
|
501
|
+
# # @return [Float]
|
502
|
+
# attr_writer :lat
|
503
|
+
|
504
|
+
# @!attribute [r] lon
|
505
|
+
# Longitude of the current position of the transit vehicle.
|
506
|
+
#
|
507
|
+
# @return [Float, nil]
|
508
|
+
optional :lon, Float
|
509
|
+
|
510
|
+
# @!parse
|
511
|
+
# # @return [Float]
|
512
|
+
# attr_writer :lon
|
513
|
+
|
514
|
+
# @!parse
|
515
|
+
# # Current position of the transit vehicle.
|
516
|
+
# #
|
517
|
+
# # @param lat [Float]
|
518
|
+
# # @param lon [Float]
|
519
|
+
# #
|
520
|
+
# def initialize(lat: nil, lon: nil, **) = super
|
521
|
+
|
522
|
+
# def initialize: (Hash | OnebusawaySDK::BaseModel) -> void
|
523
|
+
end
|
524
|
+
end
|
525
|
+
end
|
526
|
+
end
|
527
|
+
end
|
528
|
+
end
|
529
|
+
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OnebusawaySDK
|
4
|
+
# @private
|
5
|
+
#
|
6
|
+
class PooledNetRequester
|
7
|
+
class << self
|
8
|
+
# @private
|
9
|
+
#
|
10
|
+
# @param url [URI::Generic]
|
11
|
+
#
|
12
|
+
# @return [Net::HTTP]
|
13
|
+
#
|
14
|
+
def connect(url)
|
15
|
+
port =
|
16
|
+
case [url.port, url.scheme]
|
17
|
+
in [Integer, _]
|
18
|
+
url.port
|
19
|
+
in [nil, "http" | "ws"]
|
20
|
+
Net::HTTP.http_default_port
|
21
|
+
in [nil, "https" | "wss"]
|
22
|
+
Net::HTTP.https_default_port
|
23
|
+
end
|
24
|
+
|
25
|
+
Net::HTTP.new(url.host, port).tap do
|
26
|
+
_1.use_ssl = %w[https wss].include?(url.scheme)
|
27
|
+
_1.max_retries = 0
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# @private
|
32
|
+
#
|
33
|
+
# @param conn [Net::HTTP]
|
34
|
+
# @param deadline [Float]
|
35
|
+
#
|
36
|
+
def calibrate_socket_timeout(conn, deadline)
|
37
|
+
timeout = deadline - OnebusawaySDK::Util.monotonic_secs
|
38
|
+
conn.open_timeout = conn.read_timeout = conn.write_timeout = conn.continue_timeout = timeout
|
39
|
+
end
|
40
|
+
|
41
|
+
# @private
|
42
|
+
#
|
43
|
+
# @param request [Hash{Symbol=>Object}] .
|
44
|
+
#
|
45
|
+
# @option request [Symbol] :method
|
46
|
+
#
|
47
|
+
# @option request [URI::Generic] :url
|
48
|
+
#
|
49
|
+
# @option request [Hash{String=>String}] :headers
|
50
|
+
#
|
51
|
+
# @return [Net::HTTPGenericRequest]
|
52
|
+
#
|
53
|
+
def build_request(request)
|
54
|
+
method, url, headers, body = request.fetch_values(:method, :url, :headers, :body)
|
55
|
+
req = Net::HTTPGenericRequest.new(
|
56
|
+
method.to_s.upcase,
|
57
|
+
!body.nil?,
|
58
|
+
method != :head,
|
59
|
+
url.to_s
|
60
|
+
)
|
61
|
+
|
62
|
+
headers.each { req[_1] = _2 }
|
63
|
+
|
64
|
+
case body
|
65
|
+
in nil
|
66
|
+
in String
|
67
|
+
req.body = body
|
68
|
+
in StringIO
|
69
|
+
req.body = body.string
|
70
|
+
in IO
|
71
|
+
body.rewind
|
72
|
+
req.body_stream = body
|
73
|
+
end
|
74
|
+
|
75
|
+
req
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# @private
|
80
|
+
#
|
81
|
+
# @param url [URI::Generic]
|
82
|
+
# @param blk [Proc]
|
83
|
+
#
|
84
|
+
private def with_pool(url, &blk)
|
85
|
+
origin = OnebusawaySDK::Util.uri_origin(url)
|
86
|
+
th = Thread.current
|
87
|
+
key = :"#{object_id}-#{self.class.name}-connection_in_use_for_#{origin}"
|
88
|
+
|
89
|
+
if th[key]
|
90
|
+
tap do
|
91
|
+
conn = self.class.connect(url)
|
92
|
+
return blk.call(conn)
|
93
|
+
ensure
|
94
|
+
conn.finish if conn&.started?
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
pool =
|
99
|
+
@mutex.synchronize do
|
100
|
+
@pools[origin] ||= ConnectionPool.new(size: Etc.nprocessors) do
|
101
|
+
self.class.connect(url)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
pool.with do |conn|
|
106
|
+
th[key] = true
|
107
|
+
blk.call(conn)
|
108
|
+
ensure
|
109
|
+
th[key] = nil
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# @private
|
114
|
+
#
|
115
|
+
# @param request [Hash{Symbol=>Object}] .
|
116
|
+
#
|
117
|
+
# @option request [Symbol] :method
|
118
|
+
#
|
119
|
+
# @option request [URI::Generic] :url
|
120
|
+
#
|
121
|
+
# @option request [Hash{String=>String}] :headers
|
122
|
+
#
|
123
|
+
# @option request [Object] :body
|
124
|
+
#
|
125
|
+
# @option request [Float] :deadline
|
126
|
+
#
|
127
|
+
# @return [Array(Net::HTTPResponse, Enumerable)]
|
128
|
+
#
|
129
|
+
def execute(request)
|
130
|
+
url, deadline = request.fetch_values(:url, :deadline)
|
131
|
+
req = self.class.build_request(request)
|
132
|
+
|
133
|
+
eof = false
|
134
|
+
enum = Enumerator.new do |y|
|
135
|
+
with_pool(url) do |conn|
|
136
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
137
|
+
conn.start unless conn.started?
|
138
|
+
|
139
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
140
|
+
conn.request(req) do |rsp|
|
141
|
+
y << [conn, rsp]
|
142
|
+
rsp.read_body do |bytes|
|
143
|
+
y << bytes
|
144
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
145
|
+
end
|
146
|
+
eof = true
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# need to protect the `Enumerator` against `#.rewind`
|
152
|
+
fused = false
|
153
|
+
conn, response = enum.next
|
154
|
+
body = Enumerator.new do |y|
|
155
|
+
next if fused
|
156
|
+
|
157
|
+
fused = true
|
158
|
+
loop { y << enum.next }
|
159
|
+
ensure
|
160
|
+
conn.finish if !eof && conn.started?
|
161
|
+
end
|
162
|
+
[response, (response.body = body)]
|
163
|
+
end
|
164
|
+
|
165
|
+
def initialize
|
166
|
+
@mutex = Mutex.new
|
167
|
+
@pools = {}
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|