onebusaway-sdk 1.2.13 → 1.2.14
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/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/onebusaway_sdk/internal/util.rb +31 -0
- data/lib/onebusaway_sdk/resources/arrival_and_departure.rb +4 -2
- data/lib/onebusaway_sdk/resources/report_problem_with_stop.rb +2 -1
- data/lib/onebusaway_sdk/resources/report_problem_with_trip.rb +2 -1
- data/lib/onebusaway_sdk/resources/routes_for_location.rb +2 -1
- data/lib/onebusaway_sdk/resources/schedule_for_route.rb +2 -1
- data/lib/onebusaway_sdk/resources/schedule_for_stop.rb +2 -1
- data/lib/onebusaway_sdk/resources/search_for_route.rb +2 -1
- data/lib/onebusaway_sdk/resources/search_for_stop.rb +2 -1
- data/lib/onebusaway_sdk/resources/stops_for_location.rb +2 -1
- data/lib/onebusaway_sdk/resources/stops_for_route.rb +2 -1
- data/lib/onebusaway_sdk/resources/trip_details.rb +2 -1
- data/lib/onebusaway_sdk/resources/trip_for_vehicle.rb +2 -1
- data/lib/onebusaway_sdk/resources/trips_for_location.rb +2 -1
- data/lib/onebusaway_sdk/resources/trips_for_route.rb +2 -1
- data/lib/onebusaway_sdk/resources/vehicles_for_agency.rb +2 -1
- data/lib/onebusaway_sdk/version.rb +1 -1
- data/rbi/onebusaway_sdk/internal/util.rbi +20 -0
- data/sig/onebusaway_sdk/internal/util.rbs +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 19bc5a85c3df3a1a190e63a85f24df44aa381f9b5da1d72744666b470191f10a
|
|
4
|
+
data.tar.gz: '09c384fe89d9e06ffc1bdcf6fb2488fad6e2d64adb36edf3c65ebd4d021b46b3'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd3f573928a75084e6df9c5ab12d54a1ccdc89e8bbfac5d0f84c5696086a67a2dc7e923b42a6ec7b60e9f43887a9d0028bf2ecc89eccaecf008e257b2f0b7d94
|
|
7
|
+
data.tar.gz: f41cfd9f9948b304e3796e4cc2ed0deea193ca1aeaf29001700413647609824f08a5521ca9e5da7b5b958a4800fcaf2b4f165be7b9647468b7a46f6ad3fd8999
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.14 (2026-03-03)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.2.13...v1.2.14](https://github.com/OneBusAway/ruby-sdk/compare/v1.2.13...v1.2.14)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* **ci:** add build step ([771df9f](https://github.com/OneBusAway/ruby-sdk/commit/771df9fb799886cb3eea3355c30e91909d325bc1))
|
|
10
|
+
* **internal:** codegen related update ([b698023](https://github.com/OneBusAway/ruby-sdk/commit/b6980231e2ac24fd5313a21a18a59c6f37c1d0de))
|
|
11
|
+
|
|
3
12
|
## 1.2.13 (2026-02-27)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v1.2.12...v1.2.13](https://github.com/OneBusAway/ruby-sdk/compare/v1.2.12...v1.2.13)
|
data/README.md
CHANGED
|
@@ -490,6 +490,37 @@ module OnebusawaySDK
|
|
|
490
490
|
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
|
|
491
491
|
|
|
492
492
|
class << self
|
|
493
|
+
# @api private
|
|
494
|
+
#
|
|
495
|
+
# @param query [Hash{Symbol=>Object}]
|
|
496
|
+
#
|
|
497
|
+
# @return [Hash{Symbol=>Object}]
|
|
498
|
+
def encode_query_params(query)
|
|
499
|
+
out = {}
|
|
500
|
+
query.each { write_query_param_element!(out, _1, _2) }
|
|
501
|
+
out
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
# @api private
|
|
505
|
+
#
|
|
506
|
+
# @param collection [Hash{Symbol=>Object}]
|
|
507
|
+
# @param key [String]
|
|
508
|
+
# @param element [Object]
|
|
509
|
+
#
|
|
510
|
+
# @return [nil]
|
|
511
|
+
private def write_query_param_element!(collection, key, element)
|
|
512
|
+
case element
|
|
513
|
+
in Hash
|
|
514
|
+
element.each do |name, value|
|
|
515
|
+
write_query_param_element!(collection, "#{key}[#{name}]", value)
|
|
516
|
+
end
|
|
517
|
+
in Array
|
|
518
|
+
collection[key] = element.map(&:to_s)
|
|
519
|
+
else
|
|
520
|
+
collection[key] = element.to_s
|
|
521
|
+
end
|
|
522
|
+
end
|
|
523
|
+
|
|
493
524
|
# @api private
|
|
494
525
|
#
|
|
495
526
|
# @param y [Enumerator::Yielder]
|
|
@@ -20,10 +20,11 @@ module OnebusawaySDK
|
|
|
20
20
|
# @see OnebusawaySDK::Models::ArrivalAndDepartureRetrieveParams
|
|
21
21
|
def retrieve(stop_id, params)
|
|
22
22
|
parsed, options = OnebusawaySDK::ArrivalAndDepartureRetrieveParams.dump_request(params)
|
|
23
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
23
24
|
@client.request(
|
|
24
25
|
method: :get,
|
|
25
26
|
path: ["api/where/arrival-and-departure-for-stop/%1$s.json", stop_id],
|
|
26
|
-
query:
|
|
27
|
+
query: query.transform_keys(
|
|
27
28
|
service_date: "serviceDate",
|
|
28
29
|
trip_id: "tripId",
|
|
29
30
|
stop_sequence: "stopSequence",
|
|
@@ -53,10 +54,11 @@ module OnebusawaySDK
|
|
|
53
54
|
# @see OnebusawaySDK::Models::ArrivalAndDepartureListParams
|
|
54
55
|
def list(stop_id, params = {})
|
|
55
56
|
parsed, options = OnebusawaySDK::ArrivalAndDepartureListParams.dump_request(params)
|
|
57
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
56
58
|
@client.request(
|
|
57
59
|
method: :get,
|
|
58
60
|
path: ["api/where/arrivals-and-departures-for-stop/%1$s.json", stop_id],
|
|
59
|
-
query:
|
|
61
|
+
query: query.transform_keys(minutes_after: "minutesAfter", minutes_before: "minutesBefore"),
|
|
60
62
|
model: OnebusawaySDK::Models::ArrivalAndDepartureListResponse,
|
|
61
63
|
options: options
|
|
62
64
|
)
|
|
@@ -26,10 +26,11 @@ module OnebusawaySDK
|
|
|
26
26
|
# @see OnebusawaySDK::Models::ReportProblemWithStopRetrieveParams
|
|
27
27
|
def retrieve(stop_id, params = {})
|
|
28
28
|
parsed, options = OnebusawaySDK::ReportProblemWithStopRetrieveParams.dump_request(params)
|
|
29
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
29
30
|
@client.request(
|
|
30
31
|
method: :get,
|
|
31
32
|
path: ["api/where/report-problem-with-stop/%1$s.json", stop_id],
|
|
32
|
-
query:
|
|
33
|
+
query: query.transform_keys(
|
|
33
34
|
user_comment: "userComment",
|
|
34
35
|
user_lat: "userLat",
|
|
35
36
|
user_location_accuracy: "userLocationAccuracy",
|
|
@@ -36,10 +36,11 @@ module OnebusawaySDK
|
|
|
36
36
|
# @see OnebusawaySDK::Models::ReportProblemWithTripRetrieveParams
|
|
37
37
|
def retrieve(trip_id, params = {})
|
|
38
38
|
parsed, options = OnebusawaySDK::ReportProblemWithTripRetrieveParams.dump_request(params)
|
|
39
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
39
40
|
@client.request(
|
|
40
41
|
method: :get,
|
|
41
42
|
path: ["api/where/report-problem-with-trip/%1$s.json", trip_id],
|
|
42
|
-
query:
|
|
43
|
+
query: query.transform_keys(
|
|
43
44
|
service_date: "serviceDate",
|
|
44
45
|
stop_id: "stopID",
|
|
45
46
|
user_comment: "userComment",
|
|
@@ -20,10 +20,11 @@ module OnebusawaySDK
|
|
|
20
20
|
# @see OnebusawaySDK::Models::RoutesForLocationListParams
|
|
21
21
|
def list(params)
|
|
22
22
|
parsed, options = OnebusawaySDK::RoutesForLocationListParams.dump_request(params)
|
|
23
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
23
24
|
@client.request(
|
|
24
25
|
method: :get,
|
|
25
26
|
path: "api/where/routes-for-location.json",
|
|
26
|
-
query:
|
|
27
|
+
query: query.transform_keys(lat_span: "latSpan", lon_span: "lonSpan"),
|
|
27
28
|
model: OnebusawaySDK::Models::RoutesForLocationListResponse,
|
|
28
29
|
options: options
|
|
29
30
|
)
|
|
@@ -21,10 +21,11 @@ module OnebusawaySDK
|
|
|
21
21
|
# @see OnebusawaySDK::Models::ScheduleForRouteRetrieveParams
|
|
22
22
|
def retrieve(route_id, params = {})
|
|
23
23
|
parsed, options = OnebusawaySDK::ScheduleForRouteRetrieveParams.dump_request(params)
|
|
24
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
24
25
|
@client.request(
|
|
25
26
|
method: :get,
|
|
26
27
|
path: ["api/where/schedule-for-route/%1$s.json", route_id],
|
|
27
|
-
query:
|
|
28
|
+
query: query,
|
|
28
29
|
model: OnebusawaySDK::Models::ScheduleForRouteRetrieveResponse,
|
|
29
30
|
options: options
|
|
30
31
|
)
|
|
@@ -21,10 +21,11 @@ module OnebusawaySDK
|
|
|
21
21
|
# @see OnebusawaySDK::Models::ScheduleForStopRetrieveParams
|
|
22
22
|
def retrieve(stop_id, params = {})
|
|
23
23
|
parsed, options = OnebusawaySDK::ScheduleForStopRetrieveParams.dump_request(params)
|
|
24
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
24
25
|
@client.request(
|
|
25
26
|
method: :get,
|
|
26
27
|
path: ["api/where/schedule-for-stop/%1$s.json", stop_id],
|
|
27
|
-
query:
|
|
28
|
+
query: query,
|
|
28
29
|
model: OnebusawaySDK::Models::ScheduleForStopRetrieveResponse,
|
|
29
30
|
options: options
|
|
30
31
|
)
|
|
@@ -18,10 +18,11 @@ module OnebusawaySDK
|
|
|
18
18
|
# @see OnebusawaySDK::Models::SearchForRouteListParams
|
|
19
19
|
def list(params)
|
|
20
20
|
parsed, options = OnebusawaySDK::SearchForRouteListParams.dump_request(params)
|
|
21
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
21
22
|
@client.request(
|
|
22
23
|
method: :get,
|
|
23
24
|
path: "api/where/search/route.json",
|
|
24
|
-
query:
|
|
25
|
+
query: query.transform_keys(max_count: "maxCount"),
|
|
25
26
|
model: OnebusawaySDK::Models::SearchForRouteListResponse,
|
|
26
27
|
options: options
|
|
27
28
|
)
|
|
@@ -18,10 +18,11 @@ module OnebusawaySDK
|
|
|
18
18
|
# @see OnebusawaySDK::Models::SearchForStopListParams
|
|
19
19
|
def list(params)
|
|
20
20
|
parsed, options = OnebusawaySDK::SearchForStopListParams.dump_request(params)
|
|
21
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
21
22
|
@client.request(
|
|
22
23
|
method: :get,
|
|
23
24
|
path: "api/where/search/stop.json",
|
|
24
|
-
query:
|
|
25
|
+
query: query.transform_keys(max_count: "maxCount"),
|
|
25
26
|
model: OnebusawaySDK::Models::SearchForStopListResponse,
|
|
26
27
|
options: options
|
|
27
28
|
)
|
|
@@ -26,10 +26,11 @@ module OnebusawaySDK
|
|
|
26
26
|
# @see OnebusawaySDK::Models::StopsForLocationListParams
|
|
27
27
|
def list(params)
|
|
28
28
|
parsed, options = OnebusawaySDK::StopsForLocationListParams.dump_request(params)
|
|
29
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
29
30
|
@client.request(
|
|
30
31
|
method: :get,
|
|
31
32
|
path: "api/where/stops-for-location.json",
|
|
32
|
-
query:
|
|
33
|
+
query: query.transform_keys(lat_span: "latSpan", lon_span: "lonSpan"),
|
|
33
34
|
model: OnebusawaySDK::Models::StopsForLocationListResponse,
|
|
34
35
|
options: options
|
|
35
36
|
)
|
|
@@ -20,10 +20,11 @@ module OnebusawaySDK
|
|
|
20
20
|
# @see OnebusawaySDK::Models::StopsForRouteListParams
|
|
21
21
|
def list(route_id, params = {})
|
|
22
22
|
parsed, options = OnebusawaySDK::StopsForRouteListParams.dump_request(params)
|
|
23
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
23
24
|
@client.request(
|
|
24
25
|
method: :get,
|
|
25
26
|
path: ["api/where/stops-for-route/%1$s.json", route_id],
|
|
26
|
-
query:
|
|
27
|
+
query: query.transform_keys(include_polylines: "includePolylines"),
|
|
27
28
|
model: OnebusawaySDK::Models::StopsForRouteListResponse,
|
|
28
29
|
options: options
|
|
29
30
|
)
|
|
@@ -29,10 +29,11 @@ module OnebusawaySDK
|
|
|
29
29
|
# @see OnebusawaySDK::Models::TripDetailRetrieveParams
|
|
30
30
|
def retrieve(trip_id, params = {})
|
|
31
31
|
parsed, options = OnebusawaySDK::TripDetailRetrieveParams.dump_request(params)
|
|
32
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
32
33
|
@client.request(
|
|
33
34
|
method: :get,
|
|
34
35
|
path: ["api/where/trip-details/%1$s.json", trip_id],
|
|
35
|
-
query:
|
|
36
|
+
query: query.transform_keys(
|
|
36
37
|
include_schedule: "includeSchedule",
|
|
37
38
|
include_status: "includeStatus",
|
|
38
39
|
include_trip: "includeTrip",
|
|
@@ -27,10 +27,11 @@ module OnebusawaySDK
|
|
|
27
27
|
# @see OnebusawaySDK::Models::TripForVehicleRetrieveParams
|
|
28
28
|
def retrieve(vehicle_id, params = {})
|
|
29
29
|
parsed, options = OnebusawaySDK::TripForVehicleRetrieveParams.dump_request(params)
|
|
30
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
30
31
|
@client.request(
|
|
31
32
|
method: :get,
|
|
32
33
|
path: ["api/where/trip-for-vehicle/%1$s.json", vehicle_id],
|
|
33
|
-
query:
|
|
34
|
+
query: query.transform_keys(
|
|
34
35
|
include_schedule: "includeSchedule",
|
|
35
36
|
include_status: "includeStatus",
|
|
36
37
|
include_trip: "includeTrip"
|
|
@@ -31,10 +31,11 @@ module OnebusawaySDK
|
|
|
31
31
|
# @see OnebusawaySDK::Models::TripsForLocationListParams
|
|
32
32
|
def list(params)
|
|
33
33
|
parsed, options = OnebusawaySDK::TripsForLocationListParams.dump_request(params)
|
|
34
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
34
35
|
@client.request(
|
|
35
36
|
method: :get,
|
|
36
37
|
path: "api/where/trips-for-location.json",
|
|
37
|
-
query:
|
|
38
|
+
query: query.transform_keys(
|
|
38
39
|
lat_span: "latSpan",
|
|
39
40
|
lon_span: "lonSpan",
|
|
40
41
|
include_schedule: "includeSchedule",
|
|
@@ -25,10 +25,11 @@ module OnebusawaySDK
|
|
|
25
25
|
# @see OnebusawaySDK::Models::TripsForRouteListParams
|
|
26
26
|
def list(route_id, params = {})
|
|
27
27
|
parsed, options = OnebusawaySDK::TripsForRouteListParams.dump_request(params)
|
|
28
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
28
29
|
@client.request(
|
|
29
30
|
method: :get,
|
|
30
31
|
path: ["api/where/trips-for-route/%1$s.json", route_id],
|
|
31
|
-
query:
|
|
32
|
+
query: query.transform_keys(include_schedule: "includeSchedule", include_status: "includeStatus"),
|
|
32
33
|
model: OnebusawaySDK::Models::TripsForRouteListResponse,
|
|
33
34
|
options: options
|
|
34
35
|
)
|
|
@@ -18,10 +18,11 @@ module OnebusawaySDK
|
|
|
18
18
|
# @see OnebusawaySDK::Models::VehiclesForAgencyListParams
|
|
19
19
|
def list(agency_id, params = {})
|
|
20
20
|
parsed, options = OnebusawaySDK::VehiclesForAgencyListParams.dump_request(params)
|
|
21
|
+
query = OnebusawaySDK::Internal::Util.encode_query_params(parsed)
|
|
21
22
|
@client.request(
|
|
22
23
|
method: :get,
|
|
23
24
|
path: ["api/where/vehicles-for-agency/%1$s.json", agency_id],
|
|
24
|
-
query:
|
|
25
|
+
query: query,
|
|
25
26
|
model: OnebusawaySDK::Models::VehiclesForAgencyListResponse,
|
|
26
27
|
options: options
|
|
27
28
|
)
|
|
@@ -301,6 +301,26 @@ module OnebusawaySDK
|
|
|
301
301
|
T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
|
|
302
302
|
|
|
303
303
|
class << self
|
|
304
|
+
# @api private
|
|
305
|
+
sig do
|
|
306
|
+
params(query: OnebusawaySDK::Internal::AnyHash).returns(
|
|
307
|
+
OnebusawaySDK::Internal::AnyHash
|
|
308
|
+
)
|
|
309
|
+
end
|
|
310
|
+
def encode_query_params(query)
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# @api private
|
|
314
|
+
sig do
|
|
315
|
+
params(
|
|
316
|
+
collection: OnebusawaySDK::Internal::AnyHash,
|
|
317
|
+
key: String,
|
|
318
|
+
element: T.anything
|
|
319
|
+
).void
|
|
320
|
+
end
|
|
321
|
+
private def write_query_param_element!(collection, key, element)
|
|
322
|
+
end
|
|
323
|
+
|
|
304
324
|
# @api private
|
|
305
325
|
sig do
|
|
306
326
|
params(
|
|
@@ -106,6 +106,16 @@ module OnebusawaySDK
|
|
|
106
106
|
JSON_CONTENT: Regexp
|
|
107
107
|
JSONL_CONTENT: Regexp
|
|
108
108
|
|
|
109
|
+
def encode_query_params: (
|
|
110
|
+
::Hash[Symbol, top] query
|
|
111
|
+
) -> ::Hash[Symbol, top]
|
|
112
|
+
|
|
113
|
+
private def write_query_param_element!: (
|
|
114
|
+
::Hash[Symbol, top] collection,
|
|
115
|
+
String key,
|
|
116
|
+
top element
|
|
117
|
+
) -> nil
|
|
118
|
+
|
|
109
119
|
def self?.write_multipart_content: (
|
|
110
120
|
Enumerator::Yielder y,
|
|
111
121
|
val: top,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: onebusaway-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Onebusaway SDK
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|