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.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -20
  3. data/lib/onebusaway-sdk/base_client.rb +63 -91
  4. data/lib/onebusaway-sdk/base_model.rb +489 -514
  5. data/lib/onebusaway-sdk/base_page.rb +35 -15
  6. data/lib/onebusaway-sdk/client.rb +1 -3
  7. data/lib/onebusaway-sdk/errors.rb +15 -19
  8. data/lib/onebusaway-sdk/extern.rb +1 -4
  9. data/lib/onebusaway-sdk/models/references.rb +0 -21
  10. data/lib/onebusaway-sdk/models/report_problem_with_stop_retrieve_params.rb +0 -21
  11. data/lib/onebusaway-sdk/models/report_problem_with_trip_retrieve_params.rb +0 -23
  12. data/lib/onebusaway-sdk/pooled_net_requester.rb +53 -54
  13. data/lib/onebusaway-sdk/request_options.rb +4 -11
  14. data/lib/onebusaway-sdk/resources/agencies_with_coverage.rb +0 -2
  15. data/lib/onebusaway-sdk/resources/agency.rb +0 -2
  16. data/lib/onebusaway-sdk/resources/arrival_and_departure.rb +0 -3
  17. data/lib/onebusaway-sdk/resources/block.rb +0 -2
  18. data/lib/onebusaway-sdk/resources/config.rb +0 -2
  19. data/lib/onebusaway-sdk/resources/current_time.rb +0 -2
  20. data/lib/onebusaway-sdk/resources/report_problem_with_stop.rb +0 -2
  21. data/lib/onebusaway-sdk/resources/report_problem_with_trip.rb +0 -2
  22. data/lib/onebusaway-sdk/resources/route.rb +0 -2
  23. data/lib/onebusaway-sdk/resources/route_ids_for_agency.rb +0 -2
  24. data/lib/onebusaway-sdk/resources/routes_for_agency.rb +0 -2
  25. data/lib/onebusaway-sdk/resources/routes_for_location.rb +0 -2
  26. data/lib/onebusaway-sdk/resources/schedule_for_route.rb +0 -2
  27. data/lib/onebusaway-sdk/resources/schedule_for_stop.rb +0 -2
  28. data/lib/onebusaway-sdk/resources/search_for_route.rb +0 -2
  29. data/lib/onebusaway-sdk/resources/search_for_stop.rb +0 -2
  30. data/lib/onebusaway-sdk/resources/shape.rb +0 -2
  31. data/lib/onebusaway-sdk/resources/stop.rb +0 -2
  32. data/lib/onebusaway-sdk/resources/stop_ids_for_agency.rb +0 -2
  33. data/lib/onebusaway-sdk/resources/stops_for_agency.rb +0 -2
  34. data/lib/onebusaway-sdk/resources/stops_for_location.rb +0 -2
  35. data/lib/onebusaway-sdk/resources/stops_for_route.rb +0 -2
  36. data/lib/onebusaway-sdk/resources/trip.rb +0 -2
  37. data/lib/onebusaway-sdk/resources/trip_details.rb +0 -2
  38. data/lib/onebusaway-sdk/resources/trip_for_vehicle.rb +0 -2
  39. data/lib/onebusaway-sdk/resources/trips_for_location.rb +0 -2
  40. data/lib/onebusaway-sdk/resources/trips_for_route.rb +0 -2
  41. data/lib/onebusaway-sdk/resources/vehicles_for_agency.rb +0 -2
  42. data/lib/onebusaway-sdk/util.rb +297 -96
  43. data/lib/onebusaway-sdk/version.rb +1 -1
  44. data/lib/onebusaway-sdk.rb +1 -0
  45. data/manifest.yaml +1 -0
  46. data/rbi/lib/onebusaway-sdk/base_client.rbi +52 -35
  47. data/rbi/lib/onebusaway-sdk/base_model.rbi +400 -256
  48. data/rbi/lib/onebusaway-sdk/base_page.rbi +3 -4
  49. data/rbi/lib/onebusaway-sdk/client.rbi +7 -2
  50. data/rbi/lib/onebusaway-sdk/errors.rbi +44 -10
  51. data/rbi/lib/onebusaway-sdk/extern.rbi +1 -1
  52. data/rbi/lib/onebusaway-sdk/models/agencies_with_coverage_list_params.rbi +5 -2
  53. data/rbi/lib/onebusaway-sdk/models/agencies_with_coverage_list_response.rbi +9 -6
  54. data/rbi/lib/onebusaway-sdk/models/agency_retrieve_params.rbi +5 -2
  55. data/rbi/lib/onebusaway-sdk/models/agency_retrieve_response.rbi +6 -6
  56. data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_list_params.rbi +5 -2
  57. data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_list_response.rbi +95 -14
  58. data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_params.rbi +2 -9
  59. data/rbi/lib/onebusaway-sdk/models/arrival_and_departure_retrieve_response.rbi +93 -12
  60. data/rbi/lib/onebusaway-sdk/models/block_retrieve_params.rbi +5 -2
  61. data/rbi/lib/onebusaway-sdk/models/block_retrieve_response.rbi +14 -20
  62. data/rbi/lib/onebusaway-sdk/models/config_retrieve_params.rbi +5 -2
  63. data/rbi/lib/onebusaway-sdk/models/config_retrieve_response.rbi +8 -14
  64. data/rbi/lib/onebusaway-sdk/models/current_time_retrieve_params.rbi +5 -2
  65. data/rbi/lib/onebusaway-sdk/models/current_time_retrieve_response.rbi +6 -6
  66. data/rbi/lib/onebusaway-sdk/models/references.rbi +60 -43
  67. data/rbi/lib/onebusaway-sdk/models/report_problem_with_stop_retrieve_params.rbi +10 -6
  68. data/rbi/lib/onebusaway-sdk/models/report_problem_with_trip_retrieve_params.rbi +15 -6
  69. data/rbi/lib/onebusaway-sdk/models/response_wrapper.rbi +4 -2
  70. data/rbi/lib/onebusaway-sdk/models/route_ids_for_agency_list_params.rbi +5 -2
  71. data/rbi/lib/onebusaway-sdk/models/route_ids_for_agency_list_response.rbi +4 -4
  72. data/rbi/lib/onebusaway-sdk/models/route_retrieve_params.rbi +5 -2
  73. data/rbi/lib/onebusaway-sdk/models/route_retrieve_response.rbi +6 -6
  74. data/rbi/lib/onebusaway-sdk/models/routes_for_agency_list_params.rbi +5 -2
  75. data/rbi/lib/onebusaway-sdk/models/routes_for_agency_list_response.rbi +6 -6
  76. data/rbi/lib/onebusaway-sdk/models/routes_for_location_list_params.rbi +2 -2
  77. data/rbi/lib/onebusaway-sdk/models/routes_for_location_list_response.rbi +6 -6
  78. data/rbi/lib/onebusaway-sdk/models/schedule_for_route_retrieve_params.rbi +5 -8
  79. data/rbi/lib/onebusaway-sdk/models/schedule_for_route_retrieve_response.rbi +19 -16
  80. data/rbi/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_params.rbi +5 -8
  81. data/rbi/lib/onebusaway-sdk/models/schedule_for_stop_retrieve_response.rbi +14 -14
  82. data/rbi/lib/onebusaway-sdk/models/search_for_route_list_params.rbi +4 -2
  83. data/rbi/lib/onebusaway-sdk/models/search_for_route_list_response.rbi +6 -6
  84. data/rbi/lib/onebusaway-sdk/models/search_for_stop_list_params.rbi +4 -2
  85. data/rbi/lib/onebusaway-sdk/models/search_for_stop_list_response.rbi +6 -6
  86. data/rbi/lib/onebusaway-sdk/models/shape_retrieve_params.rbi +5 -2
  87. data/rbi/lib/onebusaway-sdk/models/shape_retrieve_response.rbi +7 -6
  88. data/rbi/lib/onebusaway-sdk/models/stop_ids_for_agency_list_params.rbi +5 -2
  89. data/rbi/lib/onebusaway-sdk/models/stop_ids_for_agency_list_response.rbi +4 -4
  90. data/rbi/lib/onebusaway-sdk/models/stop_retrieve_params.rbi +5 -2
  91. data/rbi/lib/onebusaway-sdk/models/stop_retrieve_response.rbi +6 -6
  92. data/rbi/lib/onebusaway-sdk/models/stops_for_agency_list_params.rbi +5 -2
  93. data/rbi/lib/onebusaway-sdk/models/stops_for_agency_list_response.rbi +4 -4
  94. data/rbi/lib/onebusaway-sdk/models/stops_for_location_list_params.rbi +6 -2
  95. data/rbi/lib/onebusaway-sdk/models/stops_for_location_list_response.rbi +6 -6
  96. data/rbi/lib/onebusaway-sdk/models/stops_for_route_list_params.rbi +4 -2
  97. data/rbi/lib/onebusaway-sdk/models/stops_for_route_list_response.rbi +14 -14
  98. data/rbi/lib/onebusaway-sdk/models/trip_detail_retrieve_params.rbi +10 -2
  99. data/rbi/lib/onebusaway-sdk/models/trip_detail_retrieve_response.rbi +54 -23
  100. data/rbi/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_params.rbi +9 -8
  101. data/rbi/lib/onebusaway-sdk/models/trip_for_vehicle_retrieve_response.rbi +54 -23
  102. data/rbi/lib/onebusaway-sdk/models/trip_retrieve_params.rbi +5 -2
  103. data/rbi/lib/onebusaway-sdk/models/trip_retrieve_response.rbi +6 -6
  104. data/rbi/lib/onebusaway-sdk/models/trips_for_location_list_params.rbi +12 -12
  105. data/rbi/lib/onebusaway-sdk/models/trips_for_location_list_response.rbi +56 -16
  106. data/rbi/lib/onebusaway-sdk/models/trips_for_route_list_params.rbi +6 -2
  107. data/rbi/lib/onebusaway-sdk/models/trips_for_route_list_response.rbi +54 -16
  108. data/rbi/lib/onebusaway-sdk/models/vehicles_for_agency_list_params.rbi +3 -2
  109. data/rbi/lib/onebusaway-sdk/models/vehicles_for_agency_list_response.rbi +52 -14
  110. data/rbi/lib/onebusaway-sdk/pooled_net_requester.rbi +28 -13
  111. data/rbi/lib/onebusaway-sdk/request_options.rbi +25 -2
  112. data/rbi/lib/onebusaway-sdk/resources/agencies_with_coverage.rbi +4 -2
  113. data/rbi/lib/onebusaway-sdk/resources/agency.rbi +8 -3
  114. data/rbi/lib/onebusaway-sdk/resources/arrival_and_departure.rbi +14 -3
  115. data/rbi/lib/onebusaway-sdk/resources/block.rbi +8 -3
  116. data/rbi/lib/onebusaway-sdk/resources/config.rbi +3 -2
  117. data/rbi/lib/onebusaway-sdk/resources/current_time.rbi +3 -2
  118. data/rbi/lib/onebusaway-sdk/resources/report_problem_with_stop.rbi +9 -2
  119. data/rbi/lib/onebusaway-sdk/resources/report_problem_with_trip.rbi +14 -2
  120. data/rbi/lib/onebusaway-sdk/resources/route.rbi +8 -3
  121. data/rbi/lib/onebusaway-sdk/resources/route_ids_for_agency.rbi +8 -3
  122. data/rbi/lib/onebusaway-sdk/resources/routes_for_agency.rbi +8 -3
  123. data/rbi/lib/onebusaway-sdk/resources/routes_for_location.rbi +3 -2
  124. data/rbi/lib/onebusaway-sdk/resources/schedule_for_route.rbi +11 -3
  125. data/rbi/lib/onebusaway-sdk/resources/schedule_for_stop.rbi +11 -3
  126. data/rbi/lib/onebusaway-sdk/resources/search_for_route.rbi +10 -3
  127. data/rbi/lib/onebusaway-sdk/resources/search_for_stop.rbi +10 -3
  128. data/rbi/lib/onebusaway-sdk/resources/shape.rbi +8 -3
  129. data/rbi/lib/onebusaway-sdk/resources/stop.rbi +8 -3
  130. data/rbi/lib/onebusaway-sdk/resources/stop_ids_for_agency.rbi +8 -3
  131. data/rbi/lib/onebusaway-sdk/resources/stops_for_agency.rbi +8 -3
  132. data/rbi/lib/onebusaway-sdk/resources/stops_for_location.rbi +16 -3
  133. data/rbi/lib/onebusaway-sdk/resources/stops_for_route.rbi +12 -3
  134. data/rbi/lib/onebusaway-sdk/resources/trip.rbi +8 -3
  135. data/rbi/lib/onebusaway-sdk/resources/trip_details.rbi +12 -2
  136. data/rbi/lib/onebusaway-sdk/resources/trip_for_vehicle.rbi +11 -2
  137. data/rbi/lib/onebusaway-sdk/resources/trips_for_location.rbi +12 -2
  138. data/rbi/lib/onebusaway-sdk/resources/trips_for_route.rbi +15 -3
  139. data/rbi/lib/onebusaway-sdk/resources/vehicles_for_agency.rbi +10 -3
  140. data/rbi/lib/onebusaway-sdk/util.rbi +214 -83
  141. data/rbi/lib/onebusaway-sdk/version.rbi +1 -1
  142. data/sig/onebusaway-sdk/base_client.rbs +9 -8
  143. data/sig/onebusaway-sdk/base_model.rbs +8 -6
  144. data/sig/onebusaway-sdk/base_page.rbs +1 -1
  145. data/sig/onebusaway-sdk/errors.rbs +6 -5
  146. data/sig/onebusaway-sdk/pooled_net_requester.rbs +11 -4
  147. data/sig/onebusaway-sdk/request_options.rbs +4 -0
  148. data/sig/onebusaway-sdk/util.rbs +46 -2
  149. data/sig/onebusaway-sdk/version.rbs +1 -1
  150. 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
- sig { params(url: URI::Generic).returns(Net::HTTP) }
10
- def self.connect(url)
11
- end
10
+ class << self
11
+ # @api private
12
+ sig { params(url: URI::Generic).returns(Net::HTTP) }
13
+ def connect(url)
14
+ end
12
15
 
13
- sig { params(conn: Net::HTTP, deadline: Float).void }
14
- def self.calibrate_socket_timeout(conn, deadline)
15
- end
16
+ # @api private
17
+ sig { params(conn: Net::HTTP, deadline: Float).void }
18
+ def calibrate_socket_timeout(conn, deadline)
19
+ end
16
20
 
17
- sig { params(request: OnebusawaySDK::PooledNetRequester::RequestShape).returns(Net::HTTPGenericRequest) }
18
- def self.build_request(request)
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
- sig { params(url: URI::Generic, blk: T.proc.params(arg0: Net::HTTP).void).void }
22
- private def with_pool(url, &blk)
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
- sig { void }
33
- def initialize
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
- abstract!
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).void }
14
- def initialize(client:)
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(agency_id, request_options: {})
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).void }
17
- def initialize(client:)
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(stop_id, minutes_after: nil, minutes_before: nil, time: nil, request_options: {})
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).void }
43
- def initialize(client:)
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(block_id, request_options: {})
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).void }
17
- def initialize(client:)
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).void }
14
- def initialize(client:)
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).void }
14
- def initialize(client:)
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).void }
30
- def initialize(client:)
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).void }
40
- def initialize(client:)
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(route_id, request_options: {})
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).void }
17
- def initialize(client:)
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(agency_id, request_options: {})
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).void }
17
- def initialize(client:)
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(agency_id, request_options: {})
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).void }
17
- def initialize(client:)
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).void }
22
- def initialize(client:)
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(route_id, date: nil, request_options: {})
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).void }
18
- def initialize(client:)
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(stop_id, date: nil, request_options: {})
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).void }
18
- def initialize(client:)
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(input:, max_count: nil, request_options: {})
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).void }
18
- def initialize(client:)
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(input:, max_count: nil, request_options: {})
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).void }
18
- def initialize(client:)
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(shape_id, request_options: {})
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).void }
17
- def initialize(client:)
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(stop_id, request_options: {})
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).void }
17
- def initialize(client:)
21
+ sig { params(client: OnebusawaySDK::Client).returns(T.attached_class) }
22
+ def self.new(client:)
18
23
  end
19
24
  end
20
25
  end