onebusaway-sdk 0.1.0.pre.alpha.205 → 0.1.0.pre.alpha.207
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 +4 -4
- data/README.md +32 -20
- data/lib/onebusaway-sdk/base_client.rb +63 -91
- data/lib/onebusaway-sdk/base_model.rb +489 -514
- data/lib/onebusaway-sdk/base_page.rb +35 -15
- data/lib/onebusaway-sdk/client.rb +1 -3
- data/lib/onebusaway-sdk/errors.rb +15 -19
- data/lib/onebusaway-sdk/extern.rb +1 -4
- data/lib/onebusaway-sdk/models/references.rb +0 -21
- data/lib/onebusaway-sdk/models/report_problem_with_stop_retrieve_params.rb +0 -21
- data/lib/onebusaway-sdk/models/report_problem_with_trip_retrieve_params.rb +0 -23
- data/lib/onebusaway-sdk/pooled_net_requester.rb +53 -54
- data/lib/onebusaway-sdk/request_options.rb +4 -11
- data/lib/onebusaway-sdk/resources/agencies_with_coverage.rb +0 -2
- data/lib/onebusaway-sdk/resources/agency.rb +0 -2
- data/lib/onebusaway-sdk/resources/arrival_and_departure.rb +0 -3
- data/lib/onebusaway-sdk/resources/block.rb +0 -2
- data/lib/onebusaway-sdk/resources/config.rb +0 -2
- data/lib/onebusaway-sdk/resources/current_time.rb +0 -2
- data/lib/onebusaway-sdk/resources/report_problem_with_stop.rb +0 -2
- data/lib/onebusaway-sdk/resources/report_problem_with_trip.rb +0 -2
- data/lib/onebusaway-sdk/resources/route.rb +0 -2
- data/lib/onebusaway-sdk/resources/route_ids_for_agency.rb +0 -2
- data/lib/onebusaway-sdk/resources/routes_for_agency.rb +0 -2
- data/lib/onebusaway-sdk/resources/routes_for_location.rb +0 -2
- data/lib/onebusaway-sdk/resources/schedule_for_route.rb +0 -2
- data/lib/onebusaway-sdk/resources/schedule_for_stop.rb +0 -2
- data/lib/onebusaway-sdk/resources/search_for_route.rb +0 -2
- data/lib/onebusaway-sdk/resources/search_for_stop.rb +0 -2
- data/lib/onebusaway-sdk/resources/shape.rb +0 -2
- data/lib/onebusaway-sdk/resources/stop.rb +0 -2
- data/lib/onebusaway-sdk/resources/stop_ids_for_agency.rb +0 -2
- data/lib/onebusaway-sdk/resources/stops_for_agency.rb +0 -2
- data/lib/onebusaway-sdk/resources/stops_for_location.rb +0 -2
- data/lib/onebusaway-sdk/resources/stops_for_route.rb +0 -2
- data/lib/onebusaway-sdk/resources/trip.rb +0 -2
- data/lib/onebusaway-sdk/resources/trip_details.rb +0 -2
- data/lib/onebusaway-sdk/resources/trip_for_vehicle.rb +0 -2
- data/lib/onebusaway-sdk/resources/trips_for_location.rb +0 -2
- data/lib/onebusaway-sdk/resources/trips_for_route.rb +0 -2
- data/lib/onebusaway-sdk/resources/vehicles_for_agency.rb +0 -2
- data/lib/onebusaway-sdk/util.rb +297 -96
- data/lib/onebusaway-sdk/version.rb +1 -1
- data/lib/onebusaway-sdk.rb +1 -0
- data/manifest.yaml +1 -0
- data/rbi/lib/onebusaway-sdk/base_client.rbi +52 -35
- data/rbi/lib/onebusaway-sdk/base_model.rbi +400 -256
- data/rbi/lib/onebusaway-sdk/base_page.rbi +3 -4
- data/rbi/lib/onebusaway-sdk/client.rbi +7 -2
- data/rbi/lib/onebusaway-sdk/errors.rbi +44 -10
- data/rbi/lib/onebusaway-sdk/extern.rbi +1 -1
- data/rbi/lib/onebusaway-sdk/models/agencies_with_coverage_list_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/agencies_with_coverage_list_response.rbi +9 -6
- data/rbi/lib/onebusaway-sdk/models/agency_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/agency_retrieve_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_list_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_list_response.rbi +95 -14
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_params.rbi +2 -9
- data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_response.rbi +93 -12
- data/rbi/lib/onebusaway-sdk/models/block_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/block_retrieve_response.rbi +14 -20
- data/rbi/lib/onebusaway-sdk/models/config_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/config_retrieve_response.rbi +8 -14
- data/rbi/lib/onebusaway-sdk/models/current_time_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/current_time_retrieve_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/references.rbi +60 -43
- data/rbi/lib/onebusaway-sdk/models/report_problem_with_stop_retrieve_params.rbi +10 -6
- data/rbi/lib/onebusaway-sdk/models/report_problem_with_trip_retrieve_params.rbi +15 -6
- data/rbi/lib/onebusaway-sdk/models/response_wrapper.rbi +4 -2
- data/rbi/lib/onebusaway-sdk/models/route_ids_for_agency_list_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/route_ids_for_agency_list_response.rbi +4 -4
- data/rbi/lib/onebusaway-sdk/models/route_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/route_retrieve_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/routes_for_agency_list_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/routes_for_agency_list_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/routes_for_location_list_params.rbi +2 -2
- data/rbi/lib/onebusaway-sdk/models/routes_for_location_list_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/schedule_for_route_retrieve_params.rbi +5 -8
- data/rbi/lib/onebusaway-sdk/models/schedule_for_route_retrieve_response.rbi +19 -16
- data/rbi/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_params.rbi +5 -8
- data/rbi/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_response.rbi +14 -14
- data/rbi/lib/onebusaway-sdk/models/search_for_route_list_params.rbi +4 -2
- data/rbi/lib/onebusaway-sdk/models/search_for_route_list_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/search_for_stop_list_params.rbi +4 -2
- data/rbi/lib/onebusaway-sdk/models/search_for_stop_list_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/shape_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/shape_retrieve_response.rbi +7 -6
- data/rbi/lib/onebusaway-sdk/models/stop_ids_for_agency_list_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/stop_ids_for_agency_list_response.rbi +4 -4
- data/rbi/lib/onebusaway-sdk/models/stop_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/stop_retrieve_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/stops_for_agency_list_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/stops_for_agency_list_response.rbi +4 -4
- data/rbi/lib/onebusaway-sdk/models/stops_for_location_list_params.rbi +6 -2
- data/rbi/lib/onebusaway-sdk/models/stops_for_location_list_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/stops_for_route_list_params.rbi +4 -2
- data/rbi/lib/onebusaway-sdk/models/stops_for_route_list_response.rbi +14 -14
- data/rbi/lib/onebusaway-sdk/models/trip_detail_retrieve_params.rbi +10 -2
- data/rbi/lib/onebusaway-sdk/models/trip_detail_retrieve_response.rbi +54 -23
- data/rbi/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_params.rbi +9 -8
- data/rbi/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_response.rbi +54 -23
- data/rbi/lib/onebusaway-sdk/models/trip_retrieve_params.rbi +5 -2
- data/rbi/lib/onebusaway-sdk/models/trip_retrieve_response.rbi +6 -6
- data/rbi/lib/onebusaway-sdk/models/trips_for_location_list_params.rbi +12 -12
- data/rbi/lib/onebusaway-sdk/models/trips_for_location_list_response.rbi +56 -16
- data/rbi/lib/onebusaway-sdk/models/trips_for_route_list_params.rbi +6 -2
- data/rbi/lib/onebusaway-sdk/models/trips_for_route_list_response.rbi +54 -16
- data/rbi/lib/onebusaway-sdk/models/vehicles_for_agency_list_params.rbi +3 -2
- data/rbi/lib/onebusaway-sdk/models/vehicles_for_agency_list_response.rbi +52 -14
- data/rbi/lib/onebusaway-sdk/pooled_net_requester.rbi +28 -13
- data/rbi/lib/onebusaway-sdk/request_options.rbi +25 -2
- data/rbi/lib/onebusaway-sdk/resources/agencies_with_coverage.rbi +4 -2
- data/rbi/lib/onebusaway-sdk/resources/agency.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/arrival_and_departure.rbi +14 -3
- data/rbi/lib/onebusaway-sdk/resources/block.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/config.rbi +3 -2
- data/rbi/lib/onebusaway-sdk/resources/current_time.rbi +3 -2
- data/rbi/lib/onebusaway-sdk/resources/report_problem_with_stop.rbi +9 -2
- data/rbi/lib/onebusaway-sdk/resources/report_problem_with_trip.rbi +14 -2
- data/rbi/lib/onebusaway-sdk/resources/route.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/route_ids_for_agency.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/routes_for_agency.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/routes_for_location.rbi +3 -2
- data/rbi/lib/onebusaway-sdk/resources/schedule_for_route.rbi +11 -3
- data/rbi/lib/onebusaway-sdk/resources/schedule_for_stop.rbi +11 -3
- data/rbi/lib/onebusaway-sdk/resources/search_for_route.rbi +10 -3
- data/rbi/lib/onebusaway-sdk/resources/search_for_stop.rbi +10 -3
- data/rbi/lib/onebusaway-sdk/resources/shape.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/stop.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/stop_ids_for_agency.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/stops_for_agency.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/stops_for_location.rbi +16 -3
- data/rbi/lib/onebusaway-sdk/resources/stops_for_route.rbi +12 -3
- data/rbi/lib/onebusaway-sdk/resources/trip.rbi +8 -3
- data/rbi/lib/onebusaway-sdk/resources/trip_details.rbi +12 -2
- data/rbi/lib/onebusaway-sdk/resources/trip_for_vehicle.rbi +11 -2
- data/rbi/lib/onebusaway-sdk/resources/trips_for_location.rbi +12 -2
- data/rbi/lib/onebusaway-sdk/resources/trips_for_route.rbi +15 -3
- data/rbi/lib/onebusaway-sdk/resources/vehicles_for_agency.rbi +10 -3
- data/rbi/lib/onebusaway-sdk/util.rbi +214 -83
- data/rbi/lib/onebusaway-sdk/version.rbi +1 -1
- data/sig/onebusaway-sdk/base_client.rbs +9 -8
- data/sig/onebusaway-sdk/base_model.rbs +8 -6
- data/sig/onebusaway-sdk/base_page.rbs +1 -1
- data/sig/onebusaway-sdk/errors.rbs +6 -5
- data/sig/onebusaway-sdk/pooled_net_requester.rbs +11 -4
- data/sig/onebusaway-sdk/request_options.rbs +4 -0
- data/sig/onebusaway-sdk/util.rbs +46 -2
- data/sig/onebusaway-sdk/version.rbs +1 -1
- metadata +4 -4
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class StopIDsForAgency
|
6
|
+
# Get stop IDs for a specific agency
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
agency_id: String,
|
@@ -10,11 +11,15 @@ module OnebusawaySDK
|
|
10
11
|
)
|
11
12
|
.returns(OnebusawaySDK::Models::StopIDsForAgencyListResponse)
|
12
13
|
end
|
13
|
-
def list(
|
14
|
+
def list(
|
15
|
+
# ID of the agency
|
16
|
+
agency_id,
|
17
|
+
request_options: {}
|
18
|
+
)
|
14
19
|
end
|
15
20
|
|
16
|
-
sig { params(client: OnebusawaySDK::Client).
|
17
|
-
def
|
21
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
22
|
+
def self.new(client:)
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class StopsForAgency
|
6
|
+
# Get stops for a specific agency
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
agency_id: String,
|
@@ -10,11 +11,15 @@ module OnebusawaySDK
|
|
10
11
|
)
|
11
12
|
.returns(OnebusawaySDK::Models::StopsForAgencyListResponse)
|
12
13
|
end
|
13
|
-
def list(
|
14
|
+
def list(
|
15
|
+
# ID of the agency
|
16
|
+
agency_id,
|
17
|
+
request_options: {}
|
18
|
+
)
|
14
19
|
end
|
15
20
|
|
16
|
-
sig { params(client: OnebusawaySDK::Client).
|
17
|
-
def
|
21
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
22
|
+
def self.new(client:)
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class StopsForLocation
|
6
|
+
# stops-for-location
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
lat: Float,
|
@@ -15,11 +16,23 @@ module OnebusawaySDK
|
|
15
16
|
)
|
16
17
|
.returns(OnebusawaySDK::Models::StopsForLocationListResponse)
|
17
18
|
end
|
18
|
-
def list(
|
19
|
+
def list(
|
20
|
+
lat:,
|
21
|
+
lon:,
|
22
|
+
# An alternative to radius to set the search bounding box (optional)
|
23
|
+
lat_span: nil,
|
24
|
+
# An alternative to radius to set the search bounding box (optional)
|
25
|
+
lon_span: nil,
|
26
|
+
# A search query string to filter the results
|
27
|
+
query: nil,
|
28
|
+
# The radius in meters to search within
|
29
|
+
radius: nil,
|
30
|
+
request_options: {}
|
31
|
+
)
|
19
32
|
end
|
20
33
|
|
21
|
-
sig { params(client: OnebusawaySDK::Client).
|
22
|
-
def
|
34
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
35
|
+
def self.new(client:)
|
23
36
|
end
|
24
37
|
end
|
25
38
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class StopsForRoute
|
6
|
+
# Get stops for a specific route
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
route_id: String,
|
@@ -12,11 +13,19 @@ module OnebusawaySDK
|
|
12
13
|
)
|
13
14
|
.returns(OnebusawaySDK::Models::StopsForRouteListResponse)
|
14
15
|
end
|
15
|
-
def list(
|
16
|
+
def list(
|
17
|
+
# ID of the route
|
18
|
+
route_id,
|
19
|
+
# Include polyline elements in the response (default true)
|
20
|
+
include_polylines: nil,
|
21
|
+
# Specify service date (YYYY-MM-DD or epoch) (default today)
|
22
|
+
time: nil,
|
23
|
+
request_options: {}
|
24
|
+
)
|
16
25
|
end
|
17
26
|
|
18
|
-
sig { params(client: OnebusawaySDK::Client).
|
19
|
-
def
|
27
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
28
|
+
def self.new(client:)
|
20
29
|
end
|
21
30
|
end
|
22
31
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class Trip
|
6
|
+
# Get details of a specific trip
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
trip_id: String,
|
@@ -10,11 +11,15 @@ module OnebusawaySDK
|
|
10
11
|
)
|
11
12
|
.returns(OnebusawaySDK::Models::TripRetrieveResponse)
|
12
13
|
end
|
13
|
-
def retrieve(
|
14
|
+
def retrieve(
|
15
|
+
# ID of the trip
|
16
|
+
trip_id,
|
17
|
+
request_options: {}
|
18
|
+
)
|
14
19
|
end
|
15
20
|
|
16
|
-
sig { params(client: OnebusawaySDK::Client).
|
17
|
-
def
|
21
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
22
|
+
def self.new(client:)
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class TripDetails
|
6
|
+
# Retrieve Trip Details
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
trip_id: String,
|
@@ -16,18 +17,27 @@ module OnebusawaySDK
|
|
16
17
|
.returns(OnebusawaySDK::Models::TripDetailRetrieveResponse)
|
17
18
|
end
|
18
19
|
def retrieve(
|
20
|
+
# ID of the trip to retrieve details for.
|
19
21
|
trip_id,
|
22
|
+
# Whether to include the full schedule element in the tripDetails section
|
23
|
+
# (defaults to true).
|
20
24
|
include_schedule: nil,
|
25
|
+
# Whether to include the full status element in the tripDetails section (defaults
|
26
|
+
# to true).
|
21
27
|
include_status: nil,
|
28
|
+
# Whether to include the full trip element in the references section (defaults to
|
29
|
+
# true).
|
22
30
|
include_trip: nil,
|
31
|
+
# Service date for the trip as Unix time in milliseconds (optional).
|
23
32
|
service_date: nil,
|
33
|
+
# Time parameter to query the system at a specific time (optional).
|
24
34
|
time: nil,
|
25
35
|
request_options: {}
|
26
36
|
)
|
27
37
|
end
|
28
38
|
|
29
|
-
sig { params(client: OnebusawaySDK::Client).
|
30
|
-
def
|
39
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
40
|
+
def self.new(client:)
|
31
41
|
end
|
32
42
|
end
|
33
43
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class TripForVehicle
|
6
|
+
# Retrieve trip for a specific vehicle
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
vehicle_id: String,
|
@@ -15,17 +16,25 @@ module OnebusawaySDK
|
|
15
16
|
.returns(OnebusawaySDK::Models::TripForVehicleRetrieveResponse)
|
16
17
|
end
|
17
18
|
def retrieve(
|
19
|
+
# ID of the vehicle to retrieve trip details for.
|
18
20
|
vehicle_id,
|
21
|
+
# Determines whether full <schedule/> element is included in the <tripDetails/>
|
22
|
+
# section. Defaults to false.
|
19
23
|
include_schedule: nil,
|
24
|
+
# Determines whether the full <status/> element is included in the <tripDetails/>
|
25
|
+
# section. Defaults to true.
|
20
26
|
include_status: nil,
|
27
|
+
# Determines whether full <trip/> element is included in the <references/>
|
28
|
+
# section. Defaults to false.
|
21
29
|
include_trip: nil,
|
30
|
+
# Time parameter to query the system at a specific time (optional).
|
22
31
|
time: nil,
|
23
32
|
request_options: {}
|
24
33
|
)
|
25
34
|
end
|
26
35
|
|
27
|
-
sig { params(client: OnebusawaySDK::Client).
|
28
|
-
def
|
36
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
37
|
+
def self.new(client:)
|
29
38
|
end
|
30
39
|
end
|
31
40
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class TripsForLocation
|
6
|
+
# Retrieve trips for a given location
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
lat: Float,
|
@@ -17,19 +18,28 @@ module OnebusawaySDK
|
|
17
18
|
.returns(OnebusawaySDK::Models::TripsForLocationListResponse)
|
18
19
|
end
|
19
20
|
def list(
|
21
|
+
# The latitude coordinate of the search center
|
20
22
|
lat:,
|
23
|
+
# Latitude span of the search bounding box
|
21
24
|
lat_span:,
|
25
|
+
# The longitude coordinate of the search center
|
22
26
|
lon:,
|
27
|
+
# Longitude span of the search bounding box
|
23
28
|
lon_span:,
|
29
|
+
# Whether to include full schedule elements in the tripDetails section. Defaults
|
30
|
+
# to false.
|
24
31
|
include_schedule: nil,
|
32
|
+
# Whether to include full trip elements in the references section. Defaults to
|
33
|
+
# false.
|
25
34
|
include_trip: nil,
|
35
|
+
# Specific time for the query. Defaults to the current time.
|
26
36
|
time: nil,
|
27
37
|
request_options: {}
|
28
38
|
)
|
29
39
|
end
|
30
40
|
|
31
|
-
sig { params(client: OnebusawaySDK::Client).
|
32
|
-
def
|
41
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
42
|
+
def self.new(client:)
|
33
43
|
end
|
34
44
|
end
|
35
45
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class TripsForRoute
|
6
|
+
# Search for active trips for a specific route.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
route_id: String,
|
@@ -13,11 +14,22 @@ module OnebusawaySDK
|
|
13
14
|
)
|
14
15
|
.returns(OnebusawaySDK::Models::TripsForRouteListResponse)
|
15
16
|
end
|
16
|
-
def list(
|
17
|
+
def list(
|
18
|
+
# The ID of the route.
|
19
|
+
route_id,
|
20
|
+
# Determine whether full schedule elements are included. Defaults to false.
|
21
|
+
include_schedule: nil,
|
22
|
+
# Determine whether full tripStatus elements with real-time information are
|
23
|
+
# included. Defaults to false.
|
24
|
+
include_status: nil,
|
25
|
+
# Query the system at a specific time. Useful for testing.
|
26
|
+
time: nil,
|
27
|
+
request_options: {}
|
28
|
+
)
|
17
29
|
end
|
18
30
|
|
19
|
-
sig { params(client: OnebusawaySDK::Client).
|
20
|
-
def
|
31
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
32
|
+
def self.new(client:)
|
21
33
|
end
|
22
34
|
end
|
23
35
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class VehiclesForAgency
|
6
|
+
# Get vehicles for a specific agency
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
agency_id: String,
|
@@ -11,11 +12,17 @@ module OnebusawaySDK
|
|
11
12
|
)
|
12
13
|
.returns(OnebusawaySDK::Models::VehiclesForAgencyListResponse)
|
13
14
|
end
|
14
|
-
def list(
|
15
|
+
def list(
|
16
|
+
# ID of the agency
|
17
|
+
agency_id,
|
18
|
+
# Specific time for querying the status (timestamp format)
|
19
|
+
time: nil,
|
20
|
+
request_options: {}
|
21
|
+
)
|
15
22
|
end
|
16
23
|
|
17
|
-
sig { params(client: OnebusawaySDK::Client).
|
18
|
-
def
|
24
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
25
|
+
def self.new(client:)
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
@@ -1,85 +1,121 @@
|
|
1
1
|
# typed: strong
|
2
2
|
|
3
3
|
module OnebusawaySDK
|
4
|
+
# @api private
|
4
5
|
module Util
|
6
|
+
# @api private
|
5
7
|
sig { returns(Float) }
|
6
8
|
def self.monotonic_secs
|
7
9
|
end
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
class << self
|
12
|
+
# @api private
|
13
|
+
sig { returns(String) }
|
14
|
+
def arch
|
15
|
+
end
|
12
16
|
|
13
|
-
|
14
|
-
|
17
|
+
# @api private
|
18
|
+
sig { returns(String) }
|
19
|
+
def os
|
20
|
+
end
|
15
21
|
end
|
16
22
|
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
class << self
|
24
|
+
# @api private
|
25
|
+
sig { params(input: T.anything).returns(T::Boolean) }
|
26
|
+
def primitive?(input)
|
27
|
+
end
|
20
28
|
|
21
|
-
|
22
|
-
|
23
|
-
|
29
|
+
# @api private
|
30
|
+
sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) }
|
31
|
+
def coerce_boolean(input)
|
32
|
+
end
|
24
33
|
|
25
|
-
|
26
|
-
|
27
|
-
|
34
|
+
# @api private
|
35
|
+
sig { params(input: T.anything).returns(T.nilable(T::Boolean)) }
|
36
|
+
def coerce_boolean!(input)
|
37
|
+
end
|
28
38
|
|
29
|
-
|
30
|
-
|
31
|
-
|
39
|
+
# @api private
|
40
|
+
sig { params(input: T.anything).returns(T.any(Integer, T.anything)) }
|
41
|
+
def coerce_integer(input)
|
42
|
+
end
|
32
43
|
|
33
|
-
|
34
|
-
|
35
|
-
|
44
|
+
# @api private
|
45
|
+
sig { params(input: T.anything).returns(T.any(Float, T.anything)) }
|
46
|
+
def coerce_float(input)
|
47
|
+
end
|
36
48
|
|
37
|
-
|
38
|
-
|
49
|
+
# @api private
|
50
|
+
sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) }
|
51
|
+
def coerce_hash(input)
|
52
|
+
end
|
39
53
|
end
|
40
54
|
|
41
55
|
OMIT = T.let(T.anything, T.anything)
|
42
56
|
|
43
|
-
|
44
|
-
|
45
|
-
|
57
|
+
class << self
|
58
|
+
# @api private
|
59
|
+
sig { params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns(T.anything) }
|
60
|
+
private def deep_merge_lr(lhs, rhs, concat: false)
|
61
|
+
end
|
46
62
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
sentinel:
|
59
|
-
|
63
|
+
# @api private
|
64
|
+
#
|
65
|
+
# Recursively merge one hash with another. If the values at a given key are not
|
66
|
+
# both hashes, just take the new value.
|
67
|
+
sig do
|
68
|
+
params(values: T::Array[T.anything], sentinel: T.nilable(T.anything), concat: T::Boolean)
|
69
|
+
.returns(T.anything)
|
70
|
+
end
|
71
|
+
def deep_merge(
|
72
|
+
*values,
|
73
|
+
# the value to return if no values are provided.
|
74
|
+
sentinel: nil,
|
75
|
+
# whether to merge sequences by concatenation.
|
76
|
+
concat: false
|
60
77
|
)
|
61
|
-
|
62
|
-
end
|
63
|
-
def self.dig(data, pick, sentinel = nil, &blk)
|
64
|
-
end
|
78
|
+
end
|
65
79
|
|
66
|
-
|
67
|
-
|
80
|
+
# @api private
|
81
|
+
sig do
|
82
|
+
params(
|
83
|
+
data: T.any(T::Hash[Symbol, T.anything], T::Array[T.anything], T.anything),
|
84
|
+
pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])),
|
85
|
+
sentinel: T.nilable(T.anything),
|
86
|
+
blk: T.nilable(T.proc.returns(T.anything))
|
87
|
+
)
|
88
|
+
.returns(T.nilable(T.anything))
|
89
|
+
end
|
90
|
+
def dig(data, pick, sentinel = nil, &blk)
|
91
|
+
end
|
68
92
|
end
|
69
93
|
|
70
|
-
|
71
|
-
|
72
|
-
|
94
|
+
class << self
|
95
|
+
# @api private
|
96
|
+
sig { params(uri: URI::Generic).returns(String) }
|
97
|
+
def uri_origin(uri)
|
98
|
+
end
|
73
99
|
|
74
|
-
|
75
|
-
|
100
|
+
# @api private
|
101
|
+
sig { params(path: T.any(String, T::Array[String])).returns(String) }
|
102
|
+
def interpolate_path(path)
|
103
|
+
end
|
76
104
|
end
|
77
105
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
106
|
+
class << self
|
107
|
+
# @api private
|
108
|
+
sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) }
|
109
|
+
def decode_query(query)
|
110
|
+
end
|
111
|
+
|
112
|
+
# @api private
|
113
|
+
sig do
|
114
|
+
params(query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]))
|
115
|
+
.returns(T.nilable(String))
|
116
|
+
end
|
117
|
+
def encode_query(query)
|
118
|
+
end
|
83
119
|
end
|
84
120
|
|
85
121
|
ParsedUriShape = T.type_alias do
|
@@ -92,48 +128,143 @@ module OnebusawaySDK
|
|
92
128
|
}
|
93
129
|
end
|
94
130
|
|
95
|
-
|
96
|
-
|
97
|
-
|
131
|
+
class << self
|
132
|
+
# @api private
|
133
|
+
sig { params(url: T.any(URI::Generic, String)).returns(OnebusawaySDK::Util::ParsedUriShape) }
|
134
|
+
def parse_uri(url)
|
135
|
+
end
|
98
136
|
|
99
|
-
|
100
|
-
|
101
|
-
|
137
|
+
# @api private
|
138
|
+
sig { params(parsed: OnebusawaySDK::Util::ParsedUriShape).returns(URI::Generic) }
|
139
|
+
def unparse_uri(parsed)
|
140
|
+
end
|
102
141
|
|
103
|
-
|
104
|
-
|
105
|
-
|
142
|
+
# @api private
|
143
|
+
sig do
|
144
|
+
params(lhs: OnebusawaySDK::Util::ParsedUriShape, rhs: OnebusawaySDK::Util::ParsedUriShape)
|
145
|
+
.returns(URI::Generic)
|
146
|
+
end
|
147
|
+
def join_parsed_uri(lhs, rhs)
|
148
|
+
end
|
106
149
|
end
|
107
|
-
|
150
|
+
|
151
|
+
class << self
|
152
|
+
# @api private
|
153
|
+
sig do
|
154
|
+
params(
|
155
|
+
headers: T::Hash[String,
|
156
|
+
T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))]
|
157
|
+
)
|
158
|
+
.returns(T::Hash[String, String])
|
159
|
+
end
|
160
|
+
def normalized_headers(*headers)
|
161
|
+
end
|
108
162
|
end
|
109
163
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
164
|
+
# @api private
|
165
|
+
#
|
166
|
+
# An adapter that satisfies the IO interface required by `::IO.copy_stream`
|
167
|
+
class ReadIOAdapter
|
168
|
+
# @api private
|
169
|
+
sig { params(max_len: T.nilable(Integer)).returns(String) }
|
170
|
+
private def read_enum(max_len)
|
171
|
+
end
|
172
|
+
|
173
|
+
# @api private
|
174
|
+
sig { params(max_len: T.nilable(Integer), out_string: T.nilable(String)).returns(T.nilable(String)) }
|
175
|
+
def read(max_len = nil, out_string = nil)
|
176
|
+
end
|
177
|
+
|
178
|
+
# @api private
|
179
|
+
sig do
|
180
|
+
params(
|
181
|
+
stream: T.any(String, IO, StringIO, T::Enumerable[String]),
|
182
|
+
blk: T.proc.params(arg0: String).void
|
183
|
+
)
|
184
|
+
.returns(T.attached_class)
|
185
|
+
end
|
186
|
+
def self.new(stream, &blk)
|
187
|
+
end
|
116
188
|
end
|
117
|
-
|
189
|
+
|
190
|
+
class << self
|
191
|
+
sig { params(blk: T.proc.params(y: Enumerator::Yielder).void).returns(T::Enumerable[String]) }
|
192
|
+
def string_io(&blk)
|
193
|
+
end
|
118
194
|
end
|
119
195
|
|
120
|
-
|
121
|
-
|
196
|
+
class << self
|
197
|
+
# @api private
|
198
|
+
sig do
|
199
|
+
params(y: Enumerator::Yielder, boundary: String, key: T.any(Symbol, String), val: T.anything).void
|
200
|
+
end
|
201
|
+
private def encode_multipart_formdata(y, boundary:, key:, val:)
|
202
|
+
end
|
203
|
+
|
204
|
+
# @api private
|
205
|
+
sig { params(body: T.anything).returns([String, T::Enumerable[String]]) }
|
206
|
+
private def encode_multipart_streaming(body)
|
207
|
+
end
|
208
|
+
|
209
|
+
# @api private
|
210
|
+
sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) }
|
211
|
+
def encode_content(headers, body)
|
212
|
+
end
|
213
|
+
|
214
|
+
# @api private
|
215
|
+
sig do
|
216
|
+
params(
|
217
|
+
headers: T.any(T::Hash[String, String], Net::HTTPHeader),
|
218
|
+
stream: T::Enumerable[String],
|
219
|
+
suppress_error: T::Boolean
|
220
|
+
)
|
221
|
+
.returns(T.anything)
|
222
|
+
end
|
223
|
+
def decode_content(headers, stream:, suppress_error: false)
|
224
|
+
end
|
122
225
|
end
|
123
226
|
|
124
|
-
|
125
|
-
|
227
|
+
class << self
|
228
|
+
# @api private
|
229
|
+
#
|
230
|
+
# https://doc.rust-lang.org/std/iter/trait.FusedIterator.html
|
231
|
+
sig do
|
232
|
+
params(enum: T::Enumerable[T.anything], external: T::Boolean, close: T.proc.void)
|
233
|
+
.returns(T::Enumerable[T.anything])
|
234
|
+
end
|
235
|
+
def fused_enum(enum, external: false, &close)
|
236
|
+
end
|
237
|
+
|
238
|
+
# @api private
|
239
|
+
sig { params(enum: T.nilable(T::Enumerable[T.anything])).void }
|
240
|
+
def close_fused!(enum)
|
241
|
+
end
|
242
|
+
|
243
|
+
# @api private
|
244
|
+
sig do
|
245
|
+
params(enum: T.nilable(T::Enumerable[T.anything]), blk: T.proc.params(arg0: Enumerator::Yielder).void)
|
246
|
+
.returns(T::Enumerable[T.anything])
|
247
|
+
end
|
248
|
+
def chain_fused(enum, &blk)
|
249
|
+
end
|
126
250
|
end
|
127
251
|
|
128
|
-
|
129
|
-
|
130
|
-
headers: T.any(T::Hash[String, String], Net::HTTPHeader),
|
131
|
-
stream: T::Enumerable[String],
|
132
|
-
suppress_error: T::Boolean
|
133
|
-
)
|
134
|
-
.returns(T.anything)
|
252
|
+
ServerSentEvent = T.type_alias do
|
253
|
+
{event: T.nilable(String), data: T.nilable(String), id: T.nilable(String), retry: T.nilable(Integer)}
|
135
254
|
end
|
136
|
-
|
255
|
+
|
256
|
+
class << self
|
257
|
+
# @api private
|
258
|
+
sig { params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) }
|
259
|
+
def decode_lines(enum)
|
260
|
+
end
|
261
|
+
|
262
|
+
# @api private
|
263
|
+
#
|
264
|
+
# https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
|
265
|
+
sig { params(lines: T::Enumerable[String]).returns(OnebusawaySDK::Util::ServerSentEvent) }
|
266
|
+
def decode_sse(lines)
|
267
|
+
end
|
137
268
|
end
|
138
269
|
end
|
139
270
|
end
|