onebusaway-sdk 1.0.2 → 1.0.4
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 +34 -0
- data/README.md +4 -4
- data/SECURITY.md +2 -2
- data/lib/onebusaway_sdk/internal/type/array_of.rb +8 -0
- data/lib/onebusaway_sdk/internal/type/base_model.rb +7 -0
- data/lib/onebusaway_sdk/internal/type/boolean.rb +8 -0
- data/lib/onebusaway_sdk/internal/type/enum.rb +15 -0
- data/lib/onebusaway_sdk/internal/type/file_input.rb +7 -0
- data/lib/onebusaway_sdk/internal/type/hash_of.rb +8 -0
- data/lib/onebusaway_sdk/internal/type/union.rb +15 -0
- data/lib/onebusaway_sdk/internal/type/unknown.rb +8 -0
- data/lib/onebusaway_sdk/internal/util.rb +62 -10
- data/lib/onebusaway_sdk/internal.rb +3 -0
- data/lib/onebusaway_sdk/models/agencies_with_coverage_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/agency_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/arrival_and_departure_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/arrival_and_departure_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/block_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/config_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/current_time_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/references.rb +38 -38
- data/lib/onebusaway_sdk/models/report_problem_with_stop_retrieve_params.rb +2 -2
- data/lib/onebusaway_sdk/models/report_problem_with_trip_retrieve_params.rb +2 -2
- data/lib/onebusaway_sdk/models/route_ids_for_agency_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/route_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/routes_for_agency_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/routes_for_location_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/schedule_for_stop_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/search_for_route_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/search_for_stop_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/shape_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/stop_ids_for_agency_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/stop_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/stops_for_agency_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/stops_for_location_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/stops_for_route_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/trip_detail_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/trip_for_vehicle_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/trip_retrieve_response.rb +2 -2
- data/lib/onebusaway_sdk/models/trips_for_location_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/trips_for_route_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models/vehicles_for_agency_list_response.rb +2 -2
- data/lib/onebusaway_sdk/models.rb +30 -19
- data/lib/onebusaway_sdk/resources/report_problem_with_stop.rb +2 -2
- data/lib/onebusaway_sdk/resources/report_problem_with_trip.rb +2 -2
- data/lib/onebusaway_sdk/version.rb +1 -1
- data/lib/onebusaway_sdk.rb +3 -1
- data/rbi/onebusaway_sdk/internal/type/array_of.rbi +6 -0
- data/rbi/onebusaway_sdk/internal/type/base_model.rbi +5 -0
- data/rbi/onebusaway_sdk/internal/type/boolean.rbi +6 -0
- data/rbi/onebusaway_sdk/internal/type/enum.rbi +5 -0
- data/rbi/onebusaway_sdk/internal/type/file_input.rbi +5 -0
- data/rbi/onebusaway_sdk/internal/type/hash_of.rbi +6 -0
- data/rbi/onebusaway_sdk/internal/type/union.rbi +5 -0
- data/rbi/onebusaway_sdk/internal/type/unknown.rbi +6 -0
- data/rbi/onebusaway_sdk/internal/util.rbi +36 -0
- data/rbi/onebusaway_sdk/internal.rbi +5 -0
- data/sig/onebusaway_sdk/internal/type/array_of.rbs +3 -0
- data/sig/onebusaway_sdk/internal/type/base_model.rbs +2 -0
- data/sig/onebusaway_sdk/internal/type/boolean.rbs +3 -0
- data/sig/onebusaway_sdk/internal/type/enum.rbs +2 -0
- data/sig/onebusaway_sdk/internal/type/file_input.rbs +2 -0
- data/sig/onebusaway_sdk/internal/type/hash_of.rbs +3 -0
- data/sig/onebusaway_sdk/internal/type/union.rbs +2 -0
- data/sig/onebusaway_sdk/internal/type/unknown.rbs +3 -0
- data/sig/onebusaway_sdk/internal/util.rbs +12 -0
- data/sig/onebusaway_sdk/internal.rbs +3 -0
- data/sig/onebusaway_sdk/models/agencies_with_coverage_list_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/agencies_with_coverage_list_response.rbs +18 -0
- data/sig/onebusaway_sdk/models/agency_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/agency_retrieve_response.rbs +23 -0
- data/sig/onebusaway_sdk/models/arrival_and_departure_list_params.rbs +7 -0
- data/sig/onebusaway_sdk/models/arrival_and_departure_list_response.rbs +84 -0
- data/sig/onebusaway_sdk/models/arrival_and_departure_retrieve_params.rbs +9 -0
- data/sig/onebusaway_sdk/models/arrival_and_departure_retrieve_response.rbs +80 -0
- data/sig/onebusaway_sdk/models/block_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/block_retrieve_response.rbs +42 -0
- data/sig/onebusaway_sdk/models/config_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/config_retrieve_response.rbs +40 -0
- data/sig/onebusaway_sdk/models/current_time_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/current_time_retrieve_response.rbs +11 -0
- data/sig/onebusaway_sdk/models/references.rbs +128 -6
- data/sig/onebusaway_sdk/models/report_problem_with_stop_retrieve_params.rbs +9 -0
- data/sig/onebusaway_sdk/models/report_problem_with_trip_retrieve_params.rbs +14 -0
- data/sig/onebusaway_sdk/models/response_wrapper.rbs +7 -0
- data/sig/onebusaway_sdk/models/route_ids_for_agency_list_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/route_ids_for_agency_list_response.rbs +10 -0
- data/sig/onebusaway_sdk/models/route_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/route_retrieve_response.rbs +22 -0
- data/sig/onebusaway_sdk/models/routes_for_agency_list_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/routes_for_agency_list_response.rbs +23 -0
- data/sig/onebusaway_sdk/models/routes_for_location_list_params.rbs +10 -0
- data/sig/onebusaway_sdk/models/routes_for_location_list_response.rbs +24 -0
- data/sig/onebusaway_sdk/models/schedule_for_route_retrieve_params.rbs +5 -0
- data/sig/onebusaway_sdk/models/schedule_for_route_retrieve_response.rbs +69 -0
- data/sig/onebusaway_sdk/models/schedule_for_stop_retrieve_params.rbs +5 -0
- data/sig/onebusaway_sdk/models/schedule_for_stop_retrieve_response.rbs +45 -0
- data/sig/onebusaway_sdk/models/search_for_route_list_params.rbs +6 -0
- data/sig/onebusaway_sdk/models/search_for_route_list_response.rbs +24 -0
- data/sig/onebusaway_sdk/models/search_for_stop_list_params.rbs +6 -0
- data/sig/onebusaway_sdk/models/search_for_stop_list_response.rbs +25 -0
- data/sig/onebusaway_sdk/models/shape_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/shape_retrieve_response.rbs +11 -0
- data/sig/onebusaway_sdk/models/stop_ids_for_agency_list_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/stop_ids_for_agency_list_response.rbs +10 -0
- data/sig/onebusaway_sdk/models/stop_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/stop_retrieve_response.rbs +23 -0
- data/sig/onebusaway_sdk/models/stops_for_agency_list_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/stops_for_agency_list_response.rbs +21 -0
- data/sig/onebusaway_sdk/models/stops_for_location_list_params.rbs +10 -0
- data/sig/onebusaway_sdk/models/stops_for_location_list_response.rbs +25 -0
- data/sig/onebusaway_sdk/models/stops_for_route_list_params.rbs +6 -0
- data/sig/onebusaway_sdk/models/stops_for_route_list_response.rbs +37 -0
- data/sig/onebusaway_sdk/models/trip_detail_retrieve_params.rbs +9 -0
- data/sig/onebusaway_sdk/models/trip_detail_retrieve_response.rbs +69 -0
- data/sig/onebusaway_sdk/models/trip_for_vehicle_retrieve_params.rbs +8 -0
- data/sig/onebusaway_sdk/models/trip_for_vehicle_retrieve_response.rbs +69 -0
- data/sig/onebusaway_sdk/models/trip_retrieve_params.rbs +2 -0
- data/sig/onebusaway_sdk/models/trip_retrieve_response.rbs +23 -0
- data/sig/onebusaway_sdk/models/trips_for_location_list_params.rbs +11 -0
- data/sig/onebusaway_sdk/models/trips_for_location_list_response.rbs +71 -0
- data/sig/onebusaway_sdk/models/trips_for_route_list_params.rbs +7 -0
- data/sig/onebusaway_sdk/models/trips_for_route_list_response.rbs +70 -0
- data/sig/onebusaway_sdk/models/vehicles_for_agency_list_params.rbs +5 -0
- data/sig/onebusaway_sdk/models/vehicles_for_agency_list_response.rbs +60 -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: 495e65d65411cfb5624b2b910d9424f2166047e1f2b302ebd43ceda6ccfea0c4
|
4
|
+
data.tar.gz: '09028f167f64c4851b6d8386154f2ece063cfe47683a0d2331ac6276b9b777e6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f59845ce1a57e9e9ce954df5f922f45010a29ffebe44c7fe53ce55c09e695af5ba35c65af1ff7b827cad5977a810d80eb157644d01f9865c34b0ad4280f2d7f8
|
7
|
+
data.tar.gz: 47c256414ddb95face79c9d5e2d10c10b8ffb244de4c67820882c4f0699078704acf8d9d23d78ea1c2e7281870ad36bf18c02c258d958f122d31df7756e6a1d8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,39 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.4 (2025-06-05)
|
4
|
+
|
5
|
+
Full Changelog: [v1.0.3...v1.0.4](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.3...v1.0.4)
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
* `to_sorbet_type` should not return branded types ([62260a5](https://github.com/OneBusAway/ruby-sdk/commit/62260a5beb28f955e636a8d8ae5054e81f0ddd1c))
|
10
|
+
* default content-type for text in multi-part formdata uploads should be text/plain ([642d274](https://github.com/OneBusAway/ruby-sdk/commit/642d274c1f710e6ec592ee5aab241f322c8d1d4a))
|
11
|
+
|
12
|
+
|
13
|
+
### Chores
|
14
|
+
|
15
|
+
* **internal:** version bump ([993b8ac](https://github.com/OneBusAway/ruby-sdk/commit/993b8ac7c60193de4157b5773da48ad76249564f))
|
16
|
+
|
17
|
+
## 1.0.3 (2025-05-28)
|
18
|
+
|
19
|
+
Full Changelog: [v1.0.2...v1.0.3](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.2...v1.0.3)
|
20
|
+
|
21
|
+
### Bug Fixes
|
22
|
+
|
23
|
+
* correctly instantiate sorbet type aliases for enums and unions ([c3220da](https://github.com/OneBusAway/ruby-sdk/commit/c3220da9c8dd308037e8713b34a9925c3b2305c9))
|
24
|
+
* prevent rubocop from mangling `===` to `is_a?` check ([4cc7c41](https://github.com/OneBusAway/ruby-sdk/commit/4cc7c41e75e9bc5589998af5b40398632242bd08))
|
25
|
+
* sorbet types for enums, and make tapioca detection ignore `tapioca dsl` ([457b3f7](https://github.com/OneBusAway/ruby-sdk/commit/457b3f74152c42720d9daa4d2050a3a93bd8a6ce))
|
26
|
+
|
27
|
+
|
28
|
+
### Chores
|
29
|
+
|
30
|
+
* **docs:** grammar improvements ([fb664c1](https://github.com/OneBusAway/ruby-sdk/commit/fb664c14ed7536ceb8f8e0a3981466572b9924b3))
|
31
|
+
* force utf-8 locale via `RUBYOPT` when formatting ([40072fa](https://github.com/OneBusAway/ruby-sdk/commit/40072fa08f936bb71c630cbab264def3d5f68fca))
|
32
|
+
* **internal:** version bump ([736a6f9](https://github.com/OneBusAway/ruby-sdk/commit/736a6f9a6f1536797d992536102ec93ff1c80984))
|
33
|
+
* refine Yard and Sorbet types and ensure linting is turned on for examples ([4491574](https://github.com/OneBusAway/ruby-sdk/commit/44915748e1ed515f15805d3f7a2f5e73d9d4e8f7))
|
34
|
+
* use fully qualified names for yard annotations and rbs aliases ([836f0a6](https://github.com/OneBusAway/ruby-sdk/commit/836f0a68ded83ff27a8dcf0c28e07bd1f29f8cba))
|
35
|
+
* whitespaces ([6588d9a](https://github.com/OneBusAway/ruby-sdk/commit/6588d9a87f890cdedbe288172f074332e34a48ff))
|
36
|
+
|
3
37
|
## 1.0.2 (2025-05-20)
|
4
38
|
|
5
39
|
Full Changelog: [v1.0.1...v1.0.2](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.1...v1.0.2)
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
17
17
|
<!-- x-release-please-start-version -->
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
gem "onebusaway-sdk", "~> 1.0.
|
20
|
+
gem "onebusaway-sdk", "~> 1.0.4"
|
21
21
|
```
|
22
22
|
|
23
23
|
<!-- x-release-please-end -->
|
@@ -144,7 +144,7 @@ puts(current_time[:my_undocumented_property])
|
|
144
144
|
|
145
145
|
#### Undocumented request params
|
146
146
|
|
147
|
-
If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request as seen in examples above.
|
147
|
+
If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.
|
148
148
|
|
149
149
|
#### Undocumented endpoints
|
150
150
|
|
@@ -162,7 +162,7 @@ response = client.request(
|
|
162
162
|
|
163
163
|
### Concurrency & connection pooling
|
164
164
|
|
165
|
-
The `OnebusawaySDK::Client` instances are threadsafe, but only are fork-safe when there are no in-flight HTTP requests.
|
165
|
+
The `OnebusawaySDK::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.
|
166
166
|
|
167
167
|
Each instance of `OnebusawaySDK::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
|
168
168
|
|
@@ -212,7 +212,7 @@ onebusaway_sdk.report_problem_with_stop.retrieve(
|
|
212
212
|
# …
|
213
213
|
)
|
214
214
|
|
215
|
-
# Literal values
|
215
|
+
# Literal values are also permissible:
|
216
216
|
onebusaway_sdk.report_problem_with_stop.retrieve(
|
217
217
|
code: :stop_name_wrong,
|
218
218
|
# …
|
data/SECURITY.md
CHANGED
@@ -16,11 +16,11 @@ before making any information public.
|
|
16
16
|
## Reporting Non-SDK Related Security Issues
|
17
17
|
|
18
18
|
If you encounter security issues that are not directly related to SDKs but pertain to the services
|
19
|
-
or products provided by Onebusaway SDK please follow the respective company's security reporting guidelines.
|
19
|
+
or products provided by Onebusaway SDK, please follow the respective company's security reporting guidelines.
|
20
20
|
|
21
21
|
### Onebusaway SDK Terms and Policies
|
22
22
|
|
23
|
-
Please contact info@onebusaway.org for any questions or concerns regarding security of our services.
|
23
|
+
Please contact info@onebusaway.org for any questions or concerns regarding the security of our services.
|
24
24
|
|
25
25
|
---
|
26
26
|
|
@@ -12,6 +12,7 @@ module OnebusawaySDK
|
|
12
12
|
# Array of items of a given type.
|
13
13
|
class ArrayOf
|
14
14
|
include OnebusawaySDK::Internal::Type::Converter
|
15
|
+
include OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
|
15
16
|
|
16
17
|
private_class_method :new
|
17
18
|
|
@@ -110,6 +111,13 @@ module OnebusawaySDK
|
|
110
111
|
end
|
111
112
|
end
|
112
113
|
|
114
|
+
# @api private
|
115
|
+
#
|
116
|
+
# @return [Object]
|
117
|
+
def to_sorbet_type
|
118
|
+
T::Array[OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(item_type)]
|
119
|
+
end
|
120
|
+
|
113
121
|
# @api private
|
114
122
|
#
|
115
123
|
# @return [generic<Elem>]
|
@@ -10,6 +10,7 @@ module OnebusawaySDK
|
|
10
10
|
# Ruby has no Boolean class; this is something for models to refer to.
|
11
11
|
class Boolean
|
12
12
|
extend OnebusawaySDK::Internal::Type::Converter
|
13
|
+
extend OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
|
13
14
|
|
14
15
|
private_class_method :new
|
15
16
|
|
@@ -56,6 +57,13 @@ module OnebusawaySDK
|
|
56
57
|
# @option state [Boolean] :can_retry
|
57
58
|
#
|
58
59
|
# @return [Boolean, Object]
|
60
|
+
|
61
|
+
# @api private
|
62
|
+
#
|
63
|
+
# @return [Object]
|
64
|
+
def to_sorbet_type
|
65
|
+
T::Boolean
|
66
|
+
end
|
59
67
|
end
|
60
68
|
end
|
61
69
|
end
|
@@ -87,6 +87,21 @@ module OnebusawaySDK
|
|
87
87
|
#
|
88
88
|
# @return [Symbol, Object]
|
89
89
|
|
90
|
+
# @api private
|
91
|
+
#
|
92
|
+
# @return [Object]
|
93
|
+
def to_sorbet_type
|
94
|
+
types = values.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
|
95
|
+
case types
|
96
|
+
in []
|
97
|
+
T.noreturn
|
98
|
+
in [type]
|
99
|
+
type
|
100
|
+
else
|
101
|
+
T.any(*types)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
90
105
|
# @api private
|
91
106
|
#
|
92
107
|
# @param depth [Integer]
|
@@ -12,6 +12,7 @@ module OnebusawaySDK
|
|
12
12
|
# Hash of items of a given type.
|
13
13
|
class HashOf
|
14
14
|
include OnebusawaySDK::Internal::Type::Converter
|
15
|
+
include OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
|
15
16
|
|
16
17
|
private_class_method :new
|
17
18
|
|
@@ -130,6 +131,13 @@ module OnebusawaySDK
|
|
130
131
|
end
|
131
132
|
end
|
132
133
|
|
134
|
+
# @api private
|
135
|
+
#
|
136
|
+
# @return [Object]
|
137
|
+
def to_sorbet_type
|
138
|
+
T::Hash[OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(item_type)]
|
139
|
+
end
|
140
|
+
|
133
141
|
# @api private
|
134
142
|
#
|
135
143
|
# @return [generic<Elem>]
|
@@ -197,6 +197,21 @@ module OnebusawaySDK
|
|
197
197
|
super
|
198
198
|
end
|
199
199
|
|
200
|
+
# @api private
|
201
|
+
#
|
202
|
+
# @return [Object]
|
203
|
+
def to_sorbet_type
|
204
|
+
types = variants.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
|
205
|
+
case types
|
206
|
+
in []
|
207
|
+
T.noreturn
|
208
|
+
in [type]
|
209
|
+
type
|
210
|
+
else
|
211
|
+
T.any(*types)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
200
215
|
# rubocop:enable Style/CaseEquality
|
201
216
|
# rubocop:enable Style/HashEachMethods
|
202
217
|
|
@@ -10,6 +10,7 @@ module OnebusawaySDK
|
|
10
10
|
# When we don't know what to expect for the value.
|
11
11
|
class Unknown
|
12
12
|
extend OnebusawaySDK::Internal::Type::Converter
|
13
|
+
extend OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
|
13
14
|
|
14
15
|
# rubocop:disable Lint/UnusedMethodArgument
|
15
16
|
|
@@ -58,6 +59,13 @@ module OnebusawaySDK
|
|
58
59
|
# @option state [Boolean] :can_retry
|
59
60
|
#
|
60
61
|
# @return [Object]
|
62
|
+
|
63
|
+
# @api private
|
64
|
+
#
|
65
|
+
# @return [Object]
|
66
|
+
def to_sorbet_type
|
67
|
+
T.anything
|
68
|
+
end
|
61
69
|
end
|
62
70
|
|
63
71
|
# rubocop:enable Lint/UnusedMethodArgument
|
@@ -9,6 +9,23 @@ module OnebusawaySDK
|
|
9
9
|
# @return [Float]
|
10
10
|
def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
11
11
|
|
12
|
+
# @api private
|
13
|
+
#
|
14
|
+
# @param ns [Module, Class]
|
15
|
+
#
|
16
|
+
# @return [Enumerable<Module, Class>]
|
17
|
+
def self.walk_namespaces(ns)
|
18
|
+
ns.constants(false).lazy.flat_map do
|
19
|
+
case (c = ns.const_get(_1, false))
|
20
|
+
in Module | Class
|
21
|
+
walk_namespaces(c)
|
22
|
+
else
|
23
|
+
[]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
.chain([ns])
|
27
|
+
end
|
28
|
+
|
12
29
|
class << self
|
13
30
|
# @api private
|
14
31
|
#
|
@@ -480,7 +497,7 @@ module OnebusawaySDK
|
|
480
497
|
# @param closing [Array<Proc>]
|
481
498
|
# @param content_type [String, nil]
|
482
499
|
private def write_multipart_content(y, val:, closing:, content_type: nil)
|
483
|
-
|
500
|
+
content_line = "Content-Type: %s\r\n\r\n"
|
484
501
|
|
485
502
|
case val
|
486
503
|
in OnebusawaySDK::FilePart
|
@@ -491,24 +508,21 @@ module OnebusawaySDK
|
|
491
508
|
content_type: val.content_type
|
492
509
|
)
|
493
510
|
in Pathname
|
494
|
-
y <<
|
511
|
+
y << format(content_line, content_type || "application/octet-stream")
|
495
512
|
io = val.open(binmode: true)
|
496
513
|
closing << io.method(:close)
|
497
514
|
IO.copy_stream(io, y)
|
498
515
|
in IO
|
499
|
-
y <<
|
516
|
+
y << format(content_line, content_type || "application/octet-stream")
|
500
517
|
IO.copy_stream(val, y)
|
501
518
|
in StringIO
|
502
|
-
y <<
|
519
|
+
y << format(content_line, content_type || "application/octet-stream")
|
503
520
|
y << val.string
|
504
|
-
in String
|
505
|
-
y << "Content-Type: #{content_type}\r\n\r\n"
|
506
|
-
y << val.to_s
|
507
521
|
in -> { primitive?(_1) }
|
508
|
-
y << "
|
522
|
+
y << format(content_line, content_type || "text/plain")
|
509
523
|
y << val.to_s
|
510
524
|
else
|
511
|
-
y << "
|
525
|
+
y << format(content_line, content_type || "application/json")
|
512
526
|
y << JSON.generate(val)
|
513
527
|
end
|
514
528
|
y << "\r\n"
|
@@ -546,6 +560,8 @@ module OnebusawaySDK
|
|
546
560
|
|
547
561
|
# @api private
|
548
562
|
#
|
563
|
+
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
|
564
|
+
#
|
549
565
|
# @param body [Object]
|
550
566
|
#
|
551
567
|
# @return [Array(String, Enumerable<String>)]
|
@@ -583,11 +599,13 @@ module OnebusawaySDK
|
|
583
599
|
#
|
584
600
|
# @return [Object]
|
585
601
|
def encode_content(headers, body)
|
602
|
+
# rubocop:disable Style/CaseEquality
|
603
|
+
# rubocop:disable Layout/LineLength
|
586
604
|
content_type = headers["content-type"]
|
587
605
|
case [content_type, body]
|
588
606
|
in [OnebusawaySDK::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }]
|
589
607
|
[headers, JSON.generate(body)]
|
590
|
-
in [OnebusawaySDK::Internal::Util::JSONL_CONTENT, Enumerable] unless
|
608
|
+
in [OnebusawaySDK::Internal::Util::JSONL_CONTENT, Enumerable] unless OnebusawaySDK::Internal::Type::FileInput === body
|
591
609
|
[headers, body.lazy.map { JSON.generate(_1) }]
|
592
610
|
in [%r{^multipart/form-data}, Hash | OnebusawaySDK::Internal::Type::FileInput]
|
593
611
|
boundary, strio = encode_multipart_streaming(body)
|
@@ -602,6 +620,8 @@ module OnebusawaySDK
|
|
602
620
|
else
|
603
621
|
[headers, body]
|
604
622
|
end
|
623
|
+
# rubocop:enable Layout/LineLength
|
624
|
+
# rubocop:enable Style/CaseEquality
|
605
625
|
end
|
606
626
|
|
607
627
|
# @api private
|
@@ -826,11 +846,43 @@ module OnebusawaySDK
|
|
826
846
|
sorbet_runtime_constants.fetch(name).call
|
827
847
|
end
|
828
848
|
|
849
|
+
# @api private
|
850
|
+
#
|
851
|
+
# @param name [Symbol]
|
852
|
+
#
|
853
|
+
# @return [Boolean]
|
854
|
+
def sorbet_constant_defined?(name) = sorbet_runtime_constants.key?(name)
|
855
|
+
|
829
856
|
# @api private
|
830
857
|
#
|
831
858
|
# @param name [Symbol]
|
832
859
|
# @param blk [Proc]
|
833
860
|
def define_sorbet_constant!(name, &blk) = sorbet_runtime_constants.store(name, blk)
|
861
|
+
|
862
|
+
# @api private
|
863
|
+
#
|
864
|
+
# @return [Object]
|
865
|
+
def to_sorbet_type = raise NotImplementedError
|
866
|
+
|
867
|
+
class << self
|
868
|
+
# @api private
|
869
|
+
#
|
870
|
+
# @param type [OnebusawaySDK::Internal::Util::SorbetRuntimeSupport, Object]
|
871
|
+
#
|
872
|
+
# @return [Object]
|
873
|
+
def to_sorbet_type(type)
|
874
|
+
case type
|
875
|
+
in OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
|
876
|
+
type.to_sorbet_type
|
877
|
+
in Class | Module
|
878
|
+
type
|
879
|
+
in true | false
|
880
|
+
T::Boolean
|
881
|
+
else
|
882
|
+
type.class
|
883
|
+
end
|
884
|
+
end
|
885
|
+
end
|
834
886
|
end
|
835
887
|
|
836
888
|
extend OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
|
@@ -13,5 +13,8 @@ module OnebusawaySDK
|
|
13
13
|
define_sorbet_constant!(:AnyHash) do
|
14
14
|
T.type_alias { T::Hash[Symbol, T.anything] }
|
15
15
|
end
|
16
|
+
define_sorbet_constant!(:FileInput) do
|
17
|
+
T.type_alias { T.any(Pathname, StringIO, IO, String, OnebusawaySDK::FilePart) }
|
18
|
+
end
|
16
19
|
end
|
17
20
|
end
|
@@ -26,13 +26,13 @@ module OnebusawaySDK
|
|
26
26
|
|
27
27
|
# @!attribute references
|
28
28
|
#
|
29
|
-
# @return [OnebusawaySDK::References]
|
29
|
+
# @return [OnebusawaySDK::Models::References]
|
30
30
|
required :references, -> { OnebusawaySDK::References }
|
31
31
|
|
32
32
|
# @!method initialize(limit_exceeded:, list:, references:)
|
33
33
|
# @param limit_exceeded [Boolean]
|
34
34
|
# @param list [Array<OnebusawaySDK::Models::AgenciesWithCoverageListResponse::Data::List>]
|
35
|
-
# @param references [OnebusawaySDK::References]
|
35
|
+
# @param references [OnebusawaySDK::Models::References]
|
36
36
|
|
37
37
|
class List < OnebusawaySDK::Internal::Type::BaseModel
|
38
38
|
# @!attribute agency_id
|
@@ -25,13 +25,13 @@ module OnebusawaySDK
|
|
25
25
|
|
26
26
|
# @!attribute references
|
27
27
|
#
|
28
|
-
# @return [OnebusawaySDK::References]
|
28
|
+
# @return [OnebusawaySDK::Models::References]
|
29
29
|
required :references, -> { OnebusawaySDK::References }
|
30
30
|
|
31
31
|
# @!method initialize(entry:, limit_exceeded:, references:)
|
32
32
|
# @param entry [OnebusawaySDK::Models::AgencyRetrieveResponse::Data::Entry]
|
33
33
|
# @param limit_exceeded [Boolean]
|
34
|
-
# @param references [OnebusawaySDK::References]
|
34
|
+
# @param references [OnebusawaySDK::Models::References]
|
35
35
|
|
36
36
|
# @see OnebusawaySDK::Models::AgencyRetrieveResponse::Data#entry
|
37
37
|
class Entry < OnebusawaySDK::Internal::Type::BaseModel
|
@@ -20,12 +20,12 @@ module OnebusawaySDK
|
|
20
20
|
|
21
21
|
# @!attribute references
|
22
22
|
#
|
23
|
-
# @return [OnebusawaySDK::References]
|
23
|
+
# @return [OnebusawaySDK::Models::References]
|
24
24
|
required :references, -> { OnebusawaySDK::References }
|
25
25
|
|
26
26
|
# @!method initialize(entry:, references:)
|
27
27
|
# @param entry [OnebusawaySDK::Models::ArrivalAndDepartureListResponse::Data::Entry]
|
28
|
-
# @param references [OnebusawaySDK::References]
|
28
|
+
# @param references [OnebusawaySDK::Models::References]
|
29
29
|
|
30
30
|
# @see OnebusawaySDK::Models::ArrivalAndDepartureListResponse::Data#entry
|
31
31
|
class Entry < OnebusawaySDK::Internal::Type::BaseModel
|
@@ -20,12 +20,12 @@ module OnebusawaySDK
|
|
20
20
|
|
21
21
|
# @!attribute references
|
22
22
|
#
|
23
|
-
# @return [OnebusawaySDK::References]
|
23
|
+
# @return [OnebusawaySDK::Models::References]
|
24
24
|
required :references, -> { OnebusawaySDK::References }
|
25
25
|
|
26
26
|
# @!method initialize(entry:, references:)
|
27
27
|
# @param entry [OnebusawaySDK::Models::ArrivalAndDepartureRetrieveResponse::Data::Entry]
|
28
|
-
# @param references [OnebusawaySDK::References]
|
28
|
+
# @param references [OnebusawaySDK::Models::References]
|
29
29
|
|
30
30
|
# @see OnebusawaySDK::Models::ArrivalAndDepartureRetrieveResponse::Data#entry
|
31
31
|
class Entry < OnebusawaySDK::Internal::Type::BaseModel
|
@@ -20,12 +20,12 @@ module OnebusawaySDK
|
|
20
20
|
|
21
21
|
# @!attribute references
|
22
22
|
#
|
23
|
-
# @return [OnebusawaySDK::References]
|
23
|
+
# @return [OnebusawaySDK::Models::References]
|
24
24
|
required :references, -> { OnebusawaySDK::References }
|
25
25
|
|
26
26
|
# @!method initialize(entry:, references:)
|
27
27
|
# @param entry [OnebusawaySDK::Models::BlockRetrieveResponse::Data::Entry]
|
28
|
-
# @param references [OnebusawaySDK::References]
|
28
|
+
# @param references [OnebusawaySDK::Models::References]
|
29
29
|
|
30
30
|
# @see OnebusawaySDK::Models::BlockRetrieveResponse::Data#entry
|
31
31
|
class Entry < OnebusawaySDK::Internal::Type::BaseModel
|
@@ -20,12 +20,12 @@ module OnebusawaySDK
|
|
20
20
|
|
21
21
|
# @!attribute references
|
22
22
|
#
|
23
|
-
# @return [OnebusawaySDK::References]
|
23
|
+
# @return [OnebusawaySDK::Models::References]
|
24
24
|
required :references, -> { OnebusawaySDK::References }
|
25
25
|
|
26
26
|
# @!method initialize(entry:, references:)
|
27
27
|
# @param entry [OnebusawaySDK::Models::ConfigRetrieveResponse::Data::Entry]
|
28
|
-
# @param references [OnebusawaySDK::References]
|
28
|
+
# @param references [OnebusawaySDK::Models::References]
|
29
29
|
|
30
30
|
# @see OnebusawaySDK::Models::ConfigRetrieveResponse::Data#entry
|
31
31
|
class Entry < OnebusawaySDK::Internal::Type::BaseModel
|
@@ -20,12 +20,12 @@ module OnebusawaySDK
|
|
20
20
|
|
21
21
|
# @!attribute references
|
22
22
|
#
|
23
|
-
# @return [OnebusawaySDK::References]
|
23
|
+
# @return [OnebusawaySDK::Models::References]
|
24
24
|
required :references, -> { OnebusawaySDK::References }
|
25
25
|
|
26
26
|
# @!method initialize(entry:, references:)
|
27
27
|
# @param entry [OnebusawaySDK::Models::CurrentTimeRetrieveResponse::Data::Entry]
|
28
|
-
# @param references [OnebusawaySDK::References]
|
28
|
+
# @param references [OnebusawaySDK::Models::References]
|
29
29
|
|
30
30
|
# @see OnebusawaySDK::Models::CurrentTimeRetrieveResponse::Data#entry
|
31
31
|
class Entry < OnebusawaySDK::Internal::Type::BaseModel
|