Skip to content

Commit bd2c9c4

Browse files
feat(api): manual updates
1 parent c0b720f commit bd2c9c4

File tree

456 files changed

+6715
-6549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

456 files changed

+6715
-6549
lines changed

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Layout/LineLength:
3939
AllowedPatterns:
4040
- "^\\s*#.*$"
4141
- ^require(_relative)?
42-
- "OpenTransit::Internal::Type::BaseModel$"
42+
- "OnebusawaySDK::Internal::Type::BaseModel$"
4343
- "^\\s*[A-Z0-9_]+ = :"
44-
- "OpenTransit::(Models|Resources|Test)::"
44+
- "OnebusawaySDK::(Models|Resources|Test)::"
4545
Max: 110
4646

4747
Layout/MultilineArrayLineBreaks:

.solargraph.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include:
55
- 'Rakefile'
66
- 'examples/**/*.rb'
77
- 'lib/**/*.rb'
8-
- 'test/open_transit/resource_namespaces.rb'
9-
- 'test/open_transit/test_helper.rb'
8+
- 'test/onebusaway_sdk/resource_namespaces.rb'
9+
- 'test/onebusaway_sdk/test_helper.rb'
1010
exclude:
1111
- 'rbi/**/*'

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-4fcbe9547537b22a2d68329e1d94e0c1a6f81b5af734ca213f7b95eef5da7adb.yml
33
openapi_spec_hash: 417ea17b08e186b15b2986372592185e
4-
config_hash: 66a75fee4c675cafae7a65b205136686
4+
config_hash: 329054917178caa31271402afcf423da

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This will install all the required dependencies.
1414

1515
## Modifying/Adding code
1616

17-
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/open_transit/helpers/` and `examples/` directory.
17+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/onebusaway_sdk/helpers/` and `examples/` directory.
1818

1919
## Adding and running examples
2020

@@ -24,7 +24,7 @@ All files in the `examples/` directory are not modified by the generator and can
2424
#!/usr/bin/env ruby
2525
# frozen_string_literal: true
2626

27-
require_relative "../lib/open_transit"
27+
require_relative "../lib/onebusaway_sdk"
2828

2929
# ...
3030
```
@@ -43,7 +43,7 @@ If you’d like to use the repository from source, you can either install from g
4343
To install via git in your `Gemfile`:
4444

4545
```ruby
46-
gem "open-transit", git: "https://www.github.com/OneBusAway/ruby-sdk"
46+
gem "onebusaway-sdk", git: "https://www.github.com/OneBusAway/ruby-sdk"
4747
```
4848

4949
Alternatively, reference local copy of the repo:
@@ -53,7 +53,7 @@ $ git clone -- 'https://www.github.com/OneBusAway/ruby-sdk' '<path-to-repo>'
5353
```
5454

5555
```ruby
56-
gem "open-transit", path: "<path-to-repo>"
56+
gem "onebusaway-sdk", path: "<path-to-repo>"
5757
```
5858

5959
## Running commands

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
open-transit (0.1.0.pre.alpha.208)
14+
onebusaway-sdk (0.1.0.pre.alpha.208)
1515
connection_pool
1616

1717
GEM
@@ -194,7 +194,7 @@ DEPENDENCIES
194194
minitest-hooks
195195
minitest-proveit
196196
minitest-rg
197-
open-transit!
197+
onebusaway-sdk!
198198
rake
199199
rbs
200200
redcarpet

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ It is generated with [Stainless](https://www.stainless.com/).
66

77
## Documentation
88

9-
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/open-transit).
9+
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/onebusaway-sdk).
1010

1111
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org).
1212

@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
1717
<!-- x-release-please-start-version -->
1818

1919
```ruby
20-
gem "open-transit", "~> 0.1.0.pre.alpha.208"
20+
gem "onebusaway-sdk", "~> 0.1.0.pre.alpha.208"
2121
```
2222

2323
<!-- x-release-please-end -->
@@ -26,9 +26,9 @@ gem "open-transit", "~> 0.1.0.pre.alpha.208"
2626

2727
```ruby
2828
require "bundler/setup"
29-
require "open_transit"
29+
require "onebusaway_sdk"
3030

31-
onebusaway_sdk = OpenTransit::Client.new(
31+
onebusaway_sdk = OnebusawaySDK::Client.new(
3232
api_key: ENV["ONEBUSAWAY_API_KEY"] # This is the default and can be omitted
3333
)
3434

@@ -39,17 +39,17 @@ puts(current_time)
3939

4040
### Handling errors
4141

42-
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `OpenTransit::Errors::APIError` will be thrown:
42+
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `OnebusawaySDK::Errors::APIError` will be thrown:
4343

4444
```ruby
4545
begin
4646
current_time = onebusaway_sdk.current_time.retrieve
47-
rescue OpenTransit::Errors::APIConnectionError => e
47+
rescue OnebusawaySDK::Errors::APIConnectionError => e
4848
puts("The server could not be reached")
4949
puts(e.cause) # an underlying Exception, likely raised within `net/http`
50-
rescue OpenTransit::Errors::RateLimitError => e
50+
rescue OnebusawaySDK::Errors::RateLimitError => e
5151
puts("A 429 status code was received; we should back off a bit.")
52-
rescue OpenTransit::Errors::APIStatusError => e
52+
rescue OnebusawaySDK::Errors::APIStatusError => e
5353
puts("Another non-200-range status code was received")
5454
puts(e.status)
5555
end
@@ -81,7 +81,7 @@ You can use the `max_retries` option to configure or disable this:
8181

8282
```ruby
8383
# Configure the default for all requests:
84-
onebusaway_sdk = OpenTransit::Client.new(
84+
onebusaway_sdk = OnebusawaySDK::Client.new(
8585
max_retries: 0 # default is 2
8686
)
8787

@@ -95,23 +95,23 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
9595

9696
```ruby
9797
# Configure the default for all requests:
98-
onebusaway_sdk = OpenTransit::Client.new(
98+
onebusaway_sdk = OnebusawaySDK::Client.new(
9999
timeout: nil # default is 60
100100
)
101101

102102
# Or, configure per-request:
103103
onebusaway_sdk.current_time.retrieve(request_options: {timeout: 5})
104104
```
105105

106-
On timeout, `OpenTransit::Errors::APITimeoutError` is raised.
106+
On timeout, `OnebusawaySDK::Errors::APITimeoutError` is raised.
107107

108108
Note that requests that time out are retried by default.
109109

110110
## Advanced concepts
111111

112112
### BaseModel
113113

114-
All parameter and response objects inherit from `OpenTransit::Internal::Type::BaseModel`, which provides several conveniences, including:
114+
All parameter and response objects inherit from `OnebusawaySDK::Internal::Type::BaseModel`, which provides several conveniences, including:
115115

116116
1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.
117117

@@ -162,9 +162,9 @@ response = client.request(
162162

163163
### Concurrency & connection pooling
164164

165-
The `OpenTransit::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 only are fork-safe when there are no in-flight HTTP requests.
166166

167-
Each instance of `OpenTransit::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.
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.
168168

169169
When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.
170170

@@ -187,7 +187,7 @@ Or, equivalently:
187187
onebusaway_sdk.current_time.retrieve
188188

189189
# You can also splat a full Params class:
190-
params = OpenTransit::CurrentTimeRetrieveParams.new
190+
params = OnebusawaySDK::CurrentTimeRetrieveParams.new
191191
onebusaway_sdk.current_time.retrieve(**params)
192192
```
193193

@@ -197,18 +197,18 @@ Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::E
197197

198198
```ruby
199199
# :stop_name_wrong
200-
puts(OpenTransit::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
200+
puts(OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
201201

202-
# Revealed type: `T.all(OpenTransit::ReportProblemWithStopRetrieveParams::Code, Symbol)`
203-
T.reveal_type(OpenTransit::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
202+
# Revealed type: `T.all(OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code, Symbol)`
203+
T.reveal_type(OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
204204
```
205205

206206
Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
207207

208208
```ruby
209209
# Using the enum constants preserves the tagged type information:
210210
onebusaway_sdk.report_problem_with_stop.retrieve(
211-
code: OpenTransit::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG,
211+
code: OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG,
212212
#
213213
)
214214

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ multitask(:"build:gem") do
147147
sig/*
148148
GLOB
149149

150-
sh(*%w[gem build -- open_transit.gemspec])
150+
sh(*%w[gem build -- onebusaway_sdk.gemspec])
151151
rm_rf(ignore_file)
152152
end
153153

lib/onebusaway_sdk.rb

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# frozen_string_literal: true
2+
3+
# Standard libraries.
4+
# rubocop:disable Lint/RedundantRequireStatement
5+
require "English"
6+
require "cgi"
7+
require "date"
8+
require "erb"
9+
require "etc"
10+
require "json"
11+
require "net/http"
12+
require "pathname"
13+
require "rbconfig"
14+
require "securerandom"
15+
require "set"
16+
require "stringio"
17+
require "time"
18+
require "uri"
19+
# rubocop:enable Lint/RedundantRequireStatement
20+
21+
# We already ship the preferred sorbet manifests in the package itself.
22+
# `tapioca` currently does not offer us a way to opt out of unnecessary compilation.
23+
if Object.const_defined?(:Tapioca) && caller.chain([$PROGRAM_NAME]).chain(ARGV).grep(/tapioca/)
24+
return
25+
end
26+
27+
# Gems.
28+
require "connection_pool"
29+
30+
# Package files.
31+
require_relative "onebusaway_sdk/version"
32+
require_relative "onebusaway_sdk/internal/util"
33+
require_relative "onebusaway_sdk/internal/type/converter"
34+
require_relative "onebusaway_sdk/internal/type/unknown"
35+
require_relative "onebusaway_sdk/internal/type/boolean"
36+
require_relative "onebusaway_sdk/internal/type/file_input"
37+
require_relative "onebusaway_sdk/internal/type/enum"
38+
require_relative "onebusaway_sdk/internal/type/union"
39+
require_relative "onebusaway_sdk/internal/type/array_of"
40+
require_relative "onebusaway_sdk/internal/type/hash_of"
41+
require_relative "onebusaway_sdk/internal/type/base_model"
42+
require_relative "onebusaway_sdk/internal/type/base_page"
43+
require_relative "onebusaway_sdk/internal/type/request_parameters"
44+
require_relative "onebusaway_sdk/internal"
45+
require_relative "onebusaway_sdk/request_options"
46+
require_relative "onebusaway_sdk/file_part"
47+
require_relative "onebusaway_sdk/errors"
48+
require_relative "onebusaway_sdk/internal/transport/base_client"
49+
require_relative "onebusaway_sdk/internal/transport/pooled_net_requester"
50+
require_relative "onebusaway_sdk/client"
51+
require_relative "onebusaway_sdk/models/response_wrapper"
52+
require_relative "onebusaway_sdk/models/agencies_with_coverage_list_params"
53+
require_relative "onebusaway_sdk/models/agencies_with_coverage_list_response"
54+
require_relative "onebusaway_sdk/models/agency_retrieve_params"
55+
require_relative "onebusaway_sdk/models/agency_retrieve_response"
56+
require_relative "onebusaway_sdk/models/arrival_and_departure_list_params"
57+
require_relative "onebusaway_sdk/models/arrival_and_departure_list_response"
58+
require_relative "onebusaway_sdk/models/arrival_and_departure_retrieve_params"
59+
require_relative "onebusaway_sdk/models/arrival_and_departure_retrieve_response"
60+
require_relative "onebusaway_sdk/models/block_retrieve_params"
61+
require_relative "onebusaway_sdk/models/block_retrieve_response"
62+
require_relative "onebusaway_sdk/models/config_retrieve_params"
63+
require_relative "onebusaway_sdk/models/config_retrieve_response"
64+
require_relative "onebusaway_sdk/models/current_time_retrieve_params"
65+
require_relative "onebusaway_sdk/models/current_time_retrieve_response"
66+
require_relative "onebusaway_sdk/models/references"
67+
require_relative "onebusaway_sdk/models/report_problem_with_stop_retrieve_params"
68+
require_relative "onebusaway_sdk/models/report_problem_with_trip_retrieve_params"
69+
require_relative "onebusaway_sdk/models/route_ids_for_agency_list_params"
70+
require_relative "onebusaway_sdk/models/route_ids_for_agency_list_response"
71+
require_relative "onebusaway_sdk/models/route_retrieve_params"
72+
require_relative "onebusaway_sdk/models/route_retrieve_response"
73+
require_relative "onebusaway_sdk/models/routes_for_agency_list_params"
74+
require_relative "onebusaway_sdk/models/routes_for_agency_list_response"
75+
require_relative "onebusaway_sdk/models/routes_for_location_list_params"
76+
require_relative "onebusaway_sdk/models/routes_for_location_list_response"
77+
require_relative "onebusaway_sdk/models/schedule_for_route_retrieve_params"
78+
require_relative "onebusaway_sdk/models/schedule_for_route_retrieve_response"
79+
require_relative "onebusaway_sdk/models/schedule_for_stop_retrieve_params"
80+
require_relative "onebusaway_sdk/models/schedule_for_stop_retrieve_response"
81+
require_relative "onebusaway_sdk/models/search_for_route_list_params"
82+
require_relative "onebusaway_sdk/models/search_for_route_list_response"
83+
require_relative "onebusaway_sdk/models/search_for_stop_list_params"
84+
require_relative "onebusaway_sdk/models/search_for_stop_list_response"
85+
require_relative "onebusaway_sdk/models/shape_retrieve_params"
86+
require_relative "onebusaway_sdk/models/shape_retrieve_response"
87+
require_relative "onebusaway_sdk/models/stop_ids_for_agency_list_params"
88+
require_relative "onebusaway_sdk/models/stop_ids_for_agency_list_response"
89+
require_relative "onebusaway_sdk/models/stop_retrieve_params"
90+
require_relative "onebusaway_sdk/models/stop_retrieve_response"
91+
require_relative "onebusaway_sdk/models/stops_for_agency_list_params"
92+
require_relative "onebusaway_sdk/models/stops_for_agency_list_response"
93+
require_relative "onebusaway_sdk/models/stops_for_location_list_params"
94+
require_relative "onebusaway_sdk/models/stops_for_location_list_response"
95+
require_relative "onebusaway_sdk/models/stops_for_route_list_params"
96+
require_relative "onebusaway_sdk/models/stops_for_route_list_response"
97+
require_relative "onebusaway_sdk/models/trip_detail_retrieve_params"
98+
require_relative "onebusaway_sdk/models/trip_detail_retrieve_response"
99+
require_relative "onebusaway_sdk/models/trip_for_vehicle_retrieve_params"
100+
require_relative "onebusaway_sdk/models/trip_for_vehicle_retrieve_response"
101+
require_relative "onebusaway_sdk/models/trip_retrieve_params"
102+
require_relative "onebusaway_sdk/models/trip_retrieve_response"
103+
require_relative "onebusaway_sdk/models/trips_for_location_list_params"
104+
require_relative "onebusaway_sdk/models/trips_for_location_list_response"
105+
require_relative "onebusaway_sdk/models/trips_for_route_list_params"
106+
require_relative "onebusaway_sdk/models/trips_for_route_list_response"
107+
require_relative "onebusaway_sdk/models/vehicles_for_agency_list_params"
108+
require_relative "onebusaway_sdk/models/vehicles_for_agency_list_response"
109+
require_relative "onebusaway_sdk/models"
110+
require_relative "onebusaway_sdk/resources/agencies_with_coverage"
111+
require_relative "onebusaway_sdk/resources/agency"
112+
require_relative "onebusaway_sdk/resources/arrival_and_departure"
113+
require_relative "onebusaway_sdk/resources/block"
114+
require_relative "onebusaway_sdk/resources/config"
115+
require_relative "onebusaway_sdk/resources/current_time"
116+
require_relative "onebusaway_sdk/resources/report_problem_with_stop"
117+
require_relative "onebusaway_sdk/resources/report_problem_with_trip"
118+
require_relative "onebusaway_sdk/resources/route"
119+
require_relative "onebusaway_sdk/resources/route_ids_for_agency"
120+
require_relative "onebusaway_sdk/resources/routes_for_agency"
121+
require_relative "onebusaway_sdk/resources/routes_for_location"
122+
require_relative "onebusaway_sdk/resources/schedule_for_route"
123+
require_relative "onebusaway_sdk/resources/schedule_for_stop"
124+
require_relative "onebusaway_sdk/resources/search_for_route"
125+
require_relative "onebusaway_sdk/resources/search_for_stop"
126+
require_relative "onebusaway_sdk/resources/shape"
127+
require_relative "onebusaway_sdk/resources/stop"
128+
require_relative "onebusaway_sdk/resources/stop_ids_for_agency"
129+
require_relative "onebusaway_sdk/resources/stops_for_agency"
130+
require_relative "onebusaway_sdk/resources/stops_for_location"
131+
require_relative "onebusaway_sdk/resources/stops_for_route"
132+
require_relative "onebusaway_sdk/resources/trip"
133+
require_relative "onebusaway_sdk/resources/trip_details"
134+
require_relative "onebusaway_sdk/resources/trip_for_vehicle"
135+
require_relative "onebusaway_sdk/resources/trips_for_location"
136+
require_relative "onebusaway_sdk/resources/trips_for_route"
137+
require_relative "onebusaway_sdk/resources/vehicles_for_agency"

0 commit comments

Comments
 (0)