onebusaway-sdk 1.0.22 → 1.0.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4237f950085e0c6f7bb3ebb7f867d4e4f4ec8ec2c120c14510baabc0ef0f4b8a
4
- data.tar.gz: e62d01c873ccdb6d405cbd92deddfb9da53546d7028a0f0446e5a286401847f8
3
+ metadata.gz: a3afa053c60ab236ae16024bb23bd68e3cdeb476801c27cb46927e8707297813
4
+ data.tar.gz: 5cfddfeeba63fc1bda4e54e8e5a327f012366df86e15eed5051fdcdd1cda8eda
5
5
  SHA512:
6
- metadata.gz: f55c5cc6c8defdead2f3009517f23cc40ba7f0c97f693b128664acdf8e7f2698cdc50c9fc0bf7a2c1f849c100f6905253d1e8d6b029f330547e16c1b50565778
7
- data.tar.gz: 290f8bf75283db50acab7e45721879fea15b6c0afa6b721c5e4b0ebc35dec8f40ace70e14173246ee13dc0db66f31429b72dfeb0e66ef1f23683a46f572f539d
6
+ metadata.gz: 1ae3604efea66c80111c2bbdb47c1748a547b738af3906847f72ee84284ef1ba0274dcce26383f714567c6e4aac297b546ad1ac7a39d0bb4218d3470fa3f9e3f
7
+ data.tar.gz: 8422ddfcd9fb6449f9025f019c733bc542b5d1f204fbc1b8017b2d4d96485ec77e289e1ccba0b4574824a95106c70b49ff908db996547da1c9e521a46a2eb6d6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.24 (2025-08-10)
4
+
5
+ Full Changelog: [v1.0.23...v1.0.24](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.23...v1.0.24)
6
+
7
+ ### Chores
8
+
9
+ * collect metadata from type DSL ([8c6ebea](https://github.com/OneBusAway/ruby-sdk/commit/8c6ebea6b7370965b7809e6747599dda37628a93))
10
+ * **internal:** update comment in script ([008e80f](https://github.com/OneBusAway/ruby-sdk/commit/008e80fd1d7f13cfe7c09f8cca1da9b11072388d))
11
+ * update @stainless-api/prism-cli to v5.15.0 ([2849a58](https://github.com/OneBusAway/ruby-sdk/commit/2849a582e1b7446b830f9e882575b9d5ba9e629c))
12
+
13
+ ## 1.0.23 (2025-08-01)
14
+
15
+ Full Changelog: [v1.0.22...v1.0.23](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.22...v1.0.23)
16
+
17
+ ### Chores
18
+
19
+ * **internal:** increase visibility of internal helper method ([98f8363](https://github.com/OneBusAway/ruby-sdk/commit/98f8363689bcfcd57d81ad5047da08ae578c8f2d))
20
+
3
21
  ## 1.0.22 (2025-07-29)
4
22
 
5
23
  Full Changelog: [v1.0.21...v1.0.22](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.21...v1.0.22)
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.22"
20
+ gem "onebusaway-sdk", "~> 1.0.24"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -368,7 +368,7 @@ module OnebusawaySDK
368
368
  #
369
369
  # @raise [OnebusawaySDK::Errors::APIError]
370
370
  # @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
371
- private def send_request(request, redirect_count:, retry_count:, send_retry_header:)
371
+ def send_request(request, redirect_count:, retry_count:, send_retry_header:)
372
372
  url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
373
373
  input = {
374
374
  **request.except(:timeout),
@@ -148,6 +148,7 @@ module OnebusawaySDK
148
148
  # @option spec [Boolean] :"nil?"
149
149
  def initialize(type_info, spec = {})
150
150
  @item_type_fn = OnebusawaySDK::Internal::Type::Converter.type_info(type_info || spec)
151
+ @meta = OnebusawaySDK::Internal::Type::Converter.meta_info(type_info, spec)
151
152
  @nilable = spec.fetch(:nil?, false)
152
153
  end
153
154
 
@@ -52,6 +52,7 @@ module OnebusawaySDK
52
52
  #
53
53
  # @option spec [Boolean] :"nil?"
54
54
  private def add_field(name_sym, required:, type_info:, spec:)
55
+ meta = OnebusawaySDK::Internal::Type::Converter.meta_info(type_info, spec)
55
56
  type_fn, info =
56
57
  case type_info
57
58
  in Proc | OnebusawaySDK::Internal::Type::Converter | Class
@@ -81,7 +82,8 @@ module OnebusawaySDK
81
82
  required: required,
82
83
  nilable: nilable,
83
84
  const: const,
84
- type_fn: type_fn
85
+ type_fn: type_fn,
86
+ meta: meta
85
87
  }
86
88
 
87
89
  define_method(setter) do |value|
@@ -98,6 +98,33 @@ module OnebusawaySDK
98
98
  end
99
99
  end
100
100
 
101
+ # @api private
102
+ #
103
+ # @param type_info [Hash{Symbol=>Object}, Proc, OnebusawaySDK::Internal::Type::Converter, Class] .
104
+ #
105
+ # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
106
+ #
107
+ # @option type_info [Proc] :enum
108
+ #
109
+ # @option type_info [Proc] :union
110
+ #
111
+ # @option type_info [Boolean] :"nil?"
112
+ #
113
+ # @param spec [Hash{Symbol=>Object}, Proc, OnebusawaySDK::Internal::Type::Converter, Class] .
114
+ #
115
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
116
+ #
117
+ # @option spec [Proc] :enum
118
+ #
119
+ # @option spec [Proc] :union
120
+ #
121
+ # @option spec [Boolean] :"nil?"
122
+ #
123
+ # @return [Hash{Symbol=>Object}]
124
+ def meta_info(type_info, spec)
125
+ [spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?)
126
+ end
127
+
101
128
  # @api private
102
129
  #
103
130
  # @param translate_names [Boolean]
@@ -168,6 +168,7 @@ module OnebusawaySDK
168
168
  # @option spec [Boolean] :"nil?"
169
169
  def initialize(type_info, spec = {})
170
170
  @item_type_fn = OnebusawaySDK::Internal::Type::Converter.type_info(type_info || spec)
171
+ @meta = OnebusawaySDK::Internal::Type::Converter.meta_info(type_info, spec)
171
172
  @nilable = spec.fetch(:nil?, false)
172
173
  end
173
174
 
@@ -12,20 +12,20 @@ module OnebusawaySDK
12
12
  #
13
13
  # All of the specified variant info for this union.
14
14
  #
15
- # @return [Array<Array(Symbol, Proc)>]
15
+ # @return [Array<Array(Symbol, Proc, Hash{Symbol=>Object})>]
16
16
  private def known_variants = (@known_variants ||= [])
17
17
 
18
18
  # @api private
19
19
  #
20
- # @return [Array<Array(Symbol, Object)>]
20
+ # @return [Array<Array(Symbol, Object, Hash{Symbol=>Object})>]
21
21
  protected def derefed_variants
22
- known_variants.map { |key, variant_fn| [key, variant_fn.call] }
22
+ known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] }
23
23
  end
24
24
 
25
25
  # All of the specified variants for this union.
26
26
  #
27
27
  # @return [Array<Object>]
28
- def variants = derefed_variants.map(&:last)
28
+ def variants = derefed_variants.map { _2 }
29
29
 
30
30
  # @api private
31
31
  #
@@ -51,12 +51,13 @@ module OnebusawaySDK
51
51
  #
52
52
  # @option spec [Boolean] :"nil?"
53
53
  private def variant(key, spec = nil)
54
+ meta = OnebusawaySDK::Internal::Type::Converter.meta_info(nil, spec)
54
55
  variant_info =
55
56
  case key
56
57
  in Symbol
57
- [key, OnebusawaySDK::Internal::Type::Converter.type_info(spec)]
58
+ [key, OnebusawaySDK::Internal::Type::Converter.type_info(spec), meta]
58
59
  in Proc | OnebusawaySDK::Internal::Type::Converter | Class | Hash
59
- [nil, OnebusawaySDK::Internal::Type::Converter.type_info(key)]
60
+ [nil, OnebusawaySDK::Internal::Type::Converter.type_info(key), meta]
60
61
  end
61
62
 
62
63
  known_variants << variant_info
@@ -79,7 +80,8 @@ module OnebusawaySDK
79
80
  return nil if key == OnebusawaySDK::Internal::OMIT
80
81
 
81
82
  key = key.to_sym if key.is_a?(String)
82
- known_variants.find { |k,| k == key }&.last&.call
83
+ _, found = known_variants.find { |k,| k == key }
84
+ found&.call
83
85
  else
84
86
  nil
85
87
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnebusawaySDK
4
- VERSION = "1.0.22"
4
+ VERSION = "1.0.24"
5
5
  end
@@ -221,7 +221,7 @@ module OnebusawaySDK
221
221
  send_retry_header: T::Boolean
222
222
  ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
223
223
  end
224
- private def send_request(
224
+ def send_request(
225
225
  request,
226
226
  redirect_count:,
227
227
  retry_count:,
@@ -95,6 +95,64 @@ module OnebusawaySDK
95
95
  def self.type_info(spec)
96
96
  end
97
97
 
98
+ # @api private
99
+ sig do
100
+ params(
101
+ type_info:
102
+ T.any(
103
+ {
104
+ const:
105
+ T.nilable(
106
+ T.any(NilClass, T::Boolean, Integer, Float, Symbol)
107
+ ),
108
+ enum:
109
+ T.nilable(
110
+ T.proc.returns(
111
+ OnebusawaySDK::Internal::Type::Converter::Input
112
+ )
113
+ ),
114
+ union:
115
+ T.nilable(
116
+ T.proc.returns(
117
+ OnebusawaySDK::Internal::Type::Converter::Input
118
+ )
119
+ )
120
+ },
121
+ T.proc.returns(
122
+ OnebusawaySDK::Internal::Type::Converter::Input
123
+ ),
124
+ OnebusawaySDK::Internal::Type::Converter::Input
125
+ ),
126
+ spec:
127
+ T.any(
128
+ {
129
+ const:
130
+ T.nilable(
131
+ T.any(NilClass, T::Boolean, Integer, Float, Symbol)
132
+ ),
133
+ enum:
134
+ T.nilable(
135
+ T.proc.returns(
136
+ OnebusawaySDK::Internal::Type::Converter::Input
137
+ )
138
+ ),
139
+ union:
140
+ T.nilable(
141
+ T.proc.returns(
142
+ OnebusawaySDK::Internal::Type::Converter::Input
143
+ )
144
+ )
145
+ },
146
+ T.proc.returns(
147
+ OnebusawaySDK::Internal::Type::Converter::Input
148
+ ),
149
+ OnebusawaySDK::Internal::Type::Converter::Input
150
+ )
151
+ ).returns(OnebusawaySDK::Internal::AnyHash)
152
+ end
153
+ def self.meta_info(type_info, spec)
154
+ end
155
+
98
156
  # @api private
99
157
  sig do
100
158
  params(translate_names: T::Boolean).returns(
@@ -16,7 +16,8 @@ module OnebusawaySDK
16
16
  T::Array[
17
17
  [
18
18
  T.nilable(Symbol),
19
- T.proc.returns(OnebusawaySDK::Internal::Type::Converter::Input)
19
+ T.proc.returns(OnebusawaySDK::Internal::Type::Converter::Input),
20
+ OnebusawaySDK::Internal::AnyHash
20
21
  ]
21
22
  ]
22
23
  )
@@ -25,7 +26,13 @@ module OnebusawaySDK
25
26
  end
26
27
 
27
28
  # @api private
28
- sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) }
29
+ sig do
30
+ returns(
31
+ T::Array[
32
+ [T.nilable(Symbol), T.anything, OnebusawaySDK::Internal::AnyHash]
33
+ ]
34
+ )
35
+ end
29
36
  protected def derefed_variants
30
37
  end
31
38
 
@@ -99,7 +99,7 @@ module OnebusawaySDK
99
99
  retry_count: Integer
100
100
  ) -> Float
101
101
 
102
- private def send_request: (
102
+ def send_request: (
103
103
  OnebusawaySDK::Internal::Transport::BaseClient::request_input request,
104
104
  redirect_count: Integer,
105
105
  retry_count: Integer,
@@ -39,6 +39,23 @@ module OnebusawaySDK
39
39
  | OnebusawaySDK::Internal::Type::Converter::input spec
40
40
  ) -> (^-> top)
41
41
 
42
+ def self.meta_info: (
43
+ {
44
+ const: (nil | bool | Integer | Float | Symbol)?,
45
+ enum: ^-> OnebusawaySDK::Internal::Type::Converter::input?,
46
+ union: ^-> OnebusawaySDK::Internal::Type::Converter::input?
47
+ }
48
+ | ^-> OnebusawaySDK::Internal::Type::Converter::input
49
+ | OnebusawaySDK::Internal::Type::Converter::input type_info,
50
+ {
51
+ const: (nil | bool | Integer | Float | Symbol)?,
52
+ enum: ^-> OnebusawaySDK::Internal::Type::Converter::input?,
53
+ union: ^-> OnebusawaySDK::Internal::Type::Converter::input?
54
+ }
55
+ | ^-> OnebusawaySDK::Internal::Type::Converter::input
56
+ | OnebusawaySDK::Internal::Type::Converter::input spec
57
+ ) -> ::Hash[Symbol, top]
58
+
42
59
  def self.new_coerce_state: (
43
60
  ?translate_names: bool
44
61
  ) -> OnebusawaySDK::Internal::Type::Converter::coerce_state
@@ -5,9 +5,9 @@ module OnebusawaySDK
5
5
  include OnebusawaySDK::Internal::Type::Converter
6
6
  include OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
7
7
 
8
- private def self.known_variants: -> ::Array[[Symbol?, (^-> OnebusawaySDK::Internal::Type::Converter::input)]]
8
+ private def self.known_variants: -> ::Array[[Symbol?, (^-> OnebusawaySDK::Internal::Type::Converter::input), ::Hash[Symbol, top]]]
9
9
 
10
- def self.derefed_variants: -> ::Array[[Symbol?, top]]
10
+ def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]
11
11
 
12
12
  def self.variants: -> ::Array[top]
13
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onebusaway-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.22
4
+ version: 1.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onebusaway SDK
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-29 00:00:00.000000000 Z
11
+ date: 2025-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool