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
@@ -1,36 +1,51 @@
|
|
1
1
|
# typed: strong
|
2
2
|
|
3
3
|
module OnebusawaySDK
|
4
|
+
# @api private
|
4
5
|
class PooledNetRequester
|
5
6
|
RequestShape = T.type_alias do
|
6
7
|
{method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float}
|
7
8
|
end
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
class << self
|
11
|
+
# @api private
|
12
|
+
sig { params(url: URI::Generic).returns(Net::HTTP) }
|
13
|
+
def connect(url)
|
14
|
+
end
|
12
15
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
# @api private
|
17
|
+
sig { params(conn: Net::HTTP, deadline: Float).void }
|
18
|
+
def calibrate_socket_timeout(conn, deadline)
|
19
|
+
end
|
16
20
|
|
17
|
-
|
18
|
-
|
21
|
+
# @api private
|
22
|
+
sig do
|
23
|
+
params(
|
24
|
+
request: OnebusawaySDK::PooledNetRequester::RequestShape,
|
25
|
+
blk: T.proc.params(arg0: String).void
|
26
|
+
)
|
27
|
+
.returns(Net::HTTPGenericRequest)
|
28
|
+
end
|
29
|
+
def build_request(request, &blk)
|
30
|
+
end
|
19
31
|
end
|
20
32
|
|
21
|
-
|
22
|
-
|
33
|
+
# @api private
|
34
|
+
sig { params(url: URI::Generic, deadline: Float, blk: T.proc.params(arg0: Net::HTTP).void).void }
|
35
|
+
private def with_pool(url, deadline:, &blk)
|
23
36
|
end
|
24
37
|
|
38
|
+
# @api private
|
25
39
|
sig do
|
26
40
|
params(request: OnebusawaySDK::PooledNetRequester::RequestShape)
|
27
|
-
.returns([Net::HTTPResponse, T::Enumerable[String]])
|
41
|
+
.returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
|
28
42
|
end
|
29
43
|
def execute(request)
|
30
44
|
end
|
31
45
|
|
32
|
-
|
33
|
-
|
46
|
+
# @api private
|
47
|
+
sig { params(size: Integer).returns(T.attached_class) }
|
48
|
+
def self.new(size: Etc.nprocessors)
|
34
49
|
end
|
35
50
|
end
|
36
51
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# typed: strong
|
2
2
|
|
3
3
|
module OnebusawaySDK
|
4
|
+
# @api private
|
4
5
|
module RequestParameters
|
5
|
-
|
6
|
-
|
6
|
+
# Options to specify HTTP behaviour for this request.
|
7
7
|
sig { returns(T.any(OnebusawaySDK::RequestOptions, T::Hash[Symbol, T.anything])) }
|
8
8
|
def request_options
|
9
9
|
end
|
@@ -15,18 +15,28 @@ module OnebusawaySDK
|
|
15
15
|
def request_options=(_)
|
16
16
|
end
|
17
17
|
|
18
|
+
# @api private
|
18
19
|
module Converter
|
20
|
+
# @api private
|
19
21
|
sig { params(params: T.anything).returns([T.anything, T::Hash[Symbol, T.anything]]) }
|
20
22
|
def dump_request(params)
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
27
|
+
# Specify HTTP behaviour to use for a specific request. These options supplement
|
28
|
+
# or override those provided at the client level.
|
29
|
+
#
|
30
|
+
# When making a request, you can pass an actual {RequestOptions} instance, or
|
31
|
+
# simply pass a Hash with symbol keys matching the attributes on this class.
|
25
32
|
class RequestOptions < OnebusawaySDK::BaseModel
|
33
|
+
# @api private
|
26
34
|
sig { params(opts: T.any(T.self_type, T::Hash[Symbol, T.anything])).void }
|
27
35
|
def self.validate!(opts)
|
28
36
|
end
|
29
37
|
|
38
|
+
# Idempotency key to send with request and all associated retries. Will only be
|
39
|
+
# sent for write requests.
|
30
40
|
sig { returns(T.nilable(String)) }
|
31
41
|
def idempotency_key
|
32
42
|
end
|
@@ -35,6 +45,8 @@ module OnebusawaySDK
|
|
35
45
|
def idempotency_key=(_)
|
36
46
|
end
|
37
47
|
|
48
|
+
# Extra query params to send with the request. These are `.merge`’d into any
|
49
|
+
# `query` given at the client level.
|
38
50
|
sig { returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) }
|
39
51
|
def extra_query
|
40
52
|
end
|
@@ -46,6 +58,8 @@ module OnebusawaySDK
|
|
46
58
|
def extra_query=(_)
|
47
59
|
end
|
48
60
|
|
61
|
+
# Extra headers to send with the request. These are `.merged`’d into any
|
62
|
+
# `extra_headers` given at the client level.
|
49
63
|
sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
|
50
64
|
def extra_headers
|
51
65
|
end
|
@@ -57,6 +71,8 @@ module OnebusawaySDK
|
|
57
71
|
def extra_headers=(_)
|
58
72
|
end
|
59
73
|
|
74
|
+
# Extra data to send with the request. These are deep merged into any data
|
75
|
+
# generated as part of the normal request.
|
60
76
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
61
77
|
def extra_body
|
62
78
|
end
|
@@ -65,6 +81,7 @@ module OnebusawaySDK
|
|
65
81
|
def extra_body=(_)
|
66
82
|
end
|
67
83
|
|
84
|
+
# Maximum number of retries to attempt after a failed initial request.
|
68
85
|
sig { returns(T.nilable(Integer)) }
|
69
86
|
def max_retries
|
70
87
|
end
|
@@ -73,6 +90,7 @@ module OnebusawaySDK
|
|
73
90
|
def max_retries=(_)
|
74
91
|
end
|
75
92
|
|
93
|
+
# Request timeout in seconds.
|
76
94
|
sig { returns(T.nilable(Float)) }
|
77
95
|
def timeout
|
78
96
|
end
|
@@ -80,5 +98,10 @@ module OnebusawaySDK
|
|
80
98
|
sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) }
|
81
99
|
def timeout=(_)
|
82
100
|
end
|
101
|
+
|
102
|
+
# Returns a new instance of RequestOptions.
|
103
|
+
sig { params(values: T::Hash[Symbol, T.anything]).returns(T.attached_class) }
|
104
|
+
def self.new(values = {})
|
105
|
+
end
|
83
106
|
end
|
84
107
|
end
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class AgenciesWithCoverage
|
6
|
+
# Returns a list of all transit agencies currently supported by OneBusAway along
|
7
|
+
# with the center of their coverage area.
|
6
8
|
sig do
|
7
9
|
params(request_options: T.nilable(T.any(OnebusawaySDK::RequestOptions, T::Hash[Symbol, T.anything])))
|
8
10
|
.returns(OnebusawaySDK::Models::AgenciesWithCoverageListResponse)
|
@@ -10,8 +12,8 @@ module OnebusawaySDK
|
|
10
12
|
def list(request_options: {})
|
11
13
|
end
|
12
14
|
|
13
|
-
sig { params(client: OnebusawaySDK::Client).
|
14
|
-
def
|
15
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
16
|
+
def self.new(client:)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class Agency
|
6
|
+
# Retrieve information for a specific transit agency identified by its unique ID.
|
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::AgencyRetrieveResponse)
|
12
13
|
end
|
13
|
-
def retrieve(
|
14
|
+
def retrieve(
|
15
|
+
# The ID of the transit 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 ArrivalAndDeparture
|
6
|
+
# arrival-and-departure-for-stop
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
stop_id: String,
|
@@ -26,6 +27,7 @@ module OnebusawaySDK
|
|
26
27
|
)
|
27
28
|
end
|
28
29
|
|
30
|
+
# arrivals-and-departures-for-stop
|
29
31
|
sig do
|
30
32
|
params(
|
31
33
|
stop_id: String,
|
@@ -36,11 +38,20 @@ module OnebusawaySDK
|
|
36
38
|
)
|
37
39
|
.returns(OnebusawaySDK::Models::ArrivalAndDepartureListResponse)
|
38
40
|
end
|
39
|
-
def list(
|
41
|
+
def list(
|
42
|
+
stop_id,
|
43
|
+
# Include vehicles arriving or departing in the next n minutes.
|
44
|
+
minutes_after: nil,
|
45
|
+
# Include vehicles having arrived or departed in the previous n minutes.
|
46
|
+
minutes_before: nil,
|
47
|
+
# The specific time for querying the system status.
|
48
|
+
time: nil,
|
49
|
+
request_options: {}
|
50
|
+
)
|
40
51
|
end
|
41
52
|
|
42
|
-
sig { params(client: OnebusawaySDK::Client).
|
43
|
-
def
|
53
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
54
|
+
def self.new(client:)
|
44
55
|
end
|
45
56
|
end
|
46
57
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class Block
|
6
|
+
# Get details of a specific block by ID
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
block_id: String,
|
@@ -10,11 +11,15 @@ module OnebusawaySDK
|
|
10
11
|
)
|
11
12
|
.returns(OnebusawaySDK::Models::BlockRetrieveResponse)
|
12
13
|
end
|
13
|
-
def retrieve(
|
14
|
+
def retrieve(
|
15
|
+
# ID of the block
|
16
|
+
block_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 Config
|
6
|
+
# config
|
6
7
|
sig do
|
7
8
|
params(request_options: T.nilable(T.any(OnebusawaySDK::RequestOptions, T::Hash[Symbol, T.anything])))
|
8
9
|
.returns(OnebusawaySDK::Models::ConfigRetrieveResponse)
|
@@ -10,8 +11,8 @@ module OnebusawaySDK
|
|
10
11
|
def retrieve(request_options: {})
|
11
12
|
end
|
12
13
|
|
13
|
-
sig { params(client: OnebusawaySDK::Client).
|
14
|
-
def
|
14
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
15
|
+
def self.new(client:)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class CurrentTime
|
6
|
+
# current-time
|
6
7
|
sig do
|
7
8
|
params(request_options: T.nilable(T.any(OnebusawaySDK::RequestOptions, T::Hash[Symbol, T.anything])))
|
8
9
|
.returns(OnebusawaySDK::Models::CurrentTimeRetrieveResponse)
|
@@ -10,8 +11,8 @@ module OnebusawaySDK
|
|
10
11
|
def retrieve(request_options: {})
|
11
12
|
end
|
12
13
|
|
13
|
-
sig { params(client: OnebusawaySDK::Client).
|
14
|
-
def
|
14
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
15
|
+
def self.new(client:)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class ReportProblemWithStop
|
6
|
+
# Submit a user-generated problem report for a stop
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
stop_id: String,
|
@@ -16,18 +17,24 @@ module OnebusawaySDK
|
|
16
17
|
.returns(OnebusawaySDK::Models::ResponseWrapper)
|
17
18
|
end
|
18
19
|
def retrieve(
|
20
|
+
# The ID of the stop
|
19
21
|
stop_id,
|
22
|
+
# A string code identifying the nature of the problem
|
20
23
|
code: nil,
|
24
|
+
# Additional comment text supplied by the user describing the problem
|
21
25
|
user_comment: nil,
|
26
|
+
# The reporting user’s current latitude
|
22
27
|
user_lat: nil,
|
28
|
+
# The reporting user’s location accuracy, in meters
|
23
29
|
user_location_accuracy: nil,
|
30
|
+
# The reporting user’s current longitude
|
24
31
|
user_lon: nil,
|
25
32
|
request_options: {}
|
26
33
|
)
|
27
34
|
end
|
28
35
|
|
29
|
-
sig { params(client: OnebusawaySDK::Client).
|
30
|
-
def
|
36
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
37
|
+
def self.new(client:)
|
31
38
|
end
|
32
39
|
end
|
33
40
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class ReportProblemWithTrip
|
6
|
+
# Submit a user-generated problem report for a particular trip.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
trip_id: String,
|
@@ -21,23 +22,34 @@ module OnebusawaySDK
|
|
21
22
|
.returns(OnebusawaySDK::Models::ResponseWrapper)
|
22
23
|
end
|
23
24
|
def retrieve(
|
25
|
+
# The ID of the trip
|
24
26
|
trip_id,
|
27
|
+
# A string code identifying the nature of the problem
|
25
28
|
code: nil,
|
29
|
+
# The service date of the trip
|
26
30
|
service_date: nil,
|
31
|
+
# A stop ID indicating where the user is experiencing the problem
|
27
32
|
stop_id: nil,
|
33
|
+
# Additional comment text supplied by the user describing the problem
|
28
34
|
user_comment: nil,
|
35
|
+
# The reporting user’s current latitude
|
29
36
|
user_lat: nil,
|
37
|
+
# The reporting user’s location accuracy, in meters
|
30
38
|
user_location_accuracy: nil,
|
39
|
+
# The reporting user’s current longitude
|
31
40
|
user_lon: nil,
|
41
|
+
# Indicator if the user is on the transit vehicle experiencing the problem
|
32
42
|
user_on_vehicle: nil,
|
43
|
+
# The vehicle number, as reported by the user
|
33
44
|
user_vehicle_number: nil,
|
45
|
+
# The vehicle actively serving the trip
|
34
46
|
vehicle_id: nil,
|
35
47
|
request_options: {}
|
36
48
|
)
|
37
49
|
end
|
38
50
|
|
39
|
-
sig { params(client: OnebusawaySDK::Client).
|
40
|
-
def
|
51
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
52
|
+
def self.new(client:)
|
41
53
|
end
|
42
54
|
end
|
43
55
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class Route
|
6
|
+
# Retrieve information for a specific route identified by its unique ID.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
route_id: String,
|
@@ -10,11 +11,15 @@ module OnebusawaySDK
|
|
10
11
|
)
|
11
12
|
.returns(OnebusawaySDK::Models::RouteRetrieveResponse)
|
12
13
|
end
|
13
|
-
def retrieve(
|
14
|
+
def retrieve(
|
15
|
+
# The ID of the route.
|
16
|
+
route_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 RouteIDsForAgency
|
6
|
+
# Get route 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::RouteIDsForAgencyListResponse)
|
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 RoutesForAgency
|
6
|
+
# Retrieve the list of all routes for a particular agency by id
|
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::RoutesForAgencyListResponse)
|
12
13
|
end
|
13
|
-
def list(
|
14
|
+
def list(
|
15
|
+
# The 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 RoutesForLocation
|
6
|
+
# routes-for-location
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
lat: Float,
|
@@ -18,8 +19,8 @@ module OnebusawaySDK
|
|
18
19
|
def list(lat:, lon:, lat_span: nil, lon_span: nil, query: nil, radius: nil, request_options: {})
|
19
20
|
end
|
20
21
|
|
21
|
-
sig { params(client: OnebusawaySDK::Client).
|
22
|
-
def
|
22
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
23
|
+
def self.new(client:)
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class ScheduleForRoute
|
6
|
+
# Retrieve the full schedule for a route on a particular day
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
route_id: String,
|
@@ -11,11 +12,18 @@ module OnebusawaySDK
|
|
11
12
|
)
|
12
13
|
.returns(OnebusawaySDK::Models::ScheduleForRouteRetrieveResponse)
|
13
14
|
end
|
14
|
-
def retrieve(
|
15
|
+
def retrieve(
|
16
|
+
# The route id to request the schedule for
|
17
|
+
route_id,
|
18
|
+
# The date for which you want to request a schedule in the format YYYY-MM-DD
|
19
|
+
# (optional, defaults to current date)
|
20
|
+
date: nil,
|
21
|
+
request_options: {}
|
22
|
+
)
|
15
23
|
end
|
16
24
|
|
17
|
-
sig { params(client: OnebusawaySDK::Client).
|
18
|
-
def
|
25
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
26
|
+
def self.new(client:)
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class ScheduleForStop
|
6
|
+
# Get schedule for a specific stop
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
stop_id: String,
|
@@ -11,11 +12,18 @@ module OnebusawaySDK
|
|
11
12
|
)
|
12
13
|
.returns(OnebusawaySDK::Models::ScheduleForStopRetrieveResponse)
|
13
14
|
end
|
14
|
-
def retrieve(
|
15
|
+
def retrieve(
|
16
|
+
# The stop id to request the schedule for, encoded directly in the URL
|
17
|
+
stop_id,
|
18
|
+
# The date for which you want to request a schedule in the format YYYY-MM-DD
|
19
|
+
# (optional, defaults to the current date)
|
20
|
+
date: nil,
|
21
|
+
request_options: {}
|
22
|
+
)
|
15
23
|
end
|
16
24
|
|
17
|
-
sig { params(client: OnebusawaySDK::Client).
|
18
|
-
def
|
25
|
+
sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
|
26
|
+
def self.new(client:)
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class SearchForRoute
|
6
|
+
# Search for a route based on its name.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
input: String,
|
@@ -11,11 +12,17 @@ module OnebusawaySDK
|
|
11
12
|
)
|
12
13
|
.returns(OnebusawaySDK::Models::SearchForRouteListResponse)
|
13
14
|
end
|
14
|
-
def list(
|
15
|
+
def list(
|
16
|
+
# The string to search for.
|
17
|
+
input:,
|
18
|
+
# The max number of results to return. Defaults to 20.
|
19
|
+
max_count: 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
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class SearchForStop
|
6
|
+
# Search for a stop based on its name.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
input: String,
|
@@ -11,11 +12,17 @@ module OnebusawaySDK
|
|
11
12
|
)
|
12
13
|
.returns(OnebusawaySDK::Models::SearchForStopListResponse)
|
13
14
|
end
|
14
|
-
def list(
|
15
|
+
def list(
|
16
|
+
# The string to search for.
|
17
|
+
input:,
|
18
|
+
# The max number of results to return. Defaults to 20.
|
19
|
+
max_count: 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
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnebusawaySDK
|
4
4
|
module Resources
|
5
5
|
class Shape
|
6
|
+
# Retrieve a shape (the path traveled by a transit vehicle) by ID.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
shape_id: String,
|
@@ -10,11 +11,15 @@ module OnebusawaySDK
|
|
10
11
|
)
|
11
12
|
.returns(OnebusawaySDK::Models::ShapeRetrieveResponse)
|
12
13
|
end
|
13
|
-
def retrieve(
|
14
|
+
def retrieve(
|
15
|
+
# The shape ID, encoded directly in the URL
|
16
|
+
shape_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 Stop
|
6
|
+
# Get details of a specific stop
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
stop_id: String,
|
@@ -10,11 +11,15 @@ module OnebusawaySDK
|
|
10
11
|
)
|
11
12
|
.returns(OnebusawaySDK::Models::StopRetrieveResponse)
|
12
13
|
end
|
13
|
-
def retrieve(
|
14
|
+
def retrieve(
|
15
|
+
# ID of the stop
|
16
|
+
stop_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
|