Skip to content

Commit 5da9848

Browse files
authored
Merge branch 'main' into VAPI-3162-REFER
2 parents dcf2409 + 78b0f76 commit 5da9848

416 files changed

Lines changed: 1261 additions & 573 deletions

File tree

Some content is hidden

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

‎.github/workflows/deploy.yml‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
deploy:
1010
name: Deploy SDK to Rubygems
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
id-token: write
1215
env:
1316
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
1417
BW_USERNAME: ${{ secrets.BW_USERNAME }}
@@ -22,7 +25,7 @@ jobs:
2225
BW_NUMBER: ${{ secrets.BW_NUMBER }}
2326
USER_NUMBER: ${{ secrets.USER_NUMBER }}
2427
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
25-
RUBY_VERSION: "3.0"
28+
RUBY_VERSION: "4.0"
2629
OPERATING_SYSTEM: "ubuntu"
2730
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
2831
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
@@ -47,12 +50,12 @@ jobs:
4750
TAG: ${{ github.event.release.tag_name }}
4851

4952
- name: Checkout
50-
uses: actions/checkout@v6
53+
uses: actions/checkout@v7
5154

5255
- name: Setup Ruby
5356
uses: ruby/setup-ruby@v1
5457
with:
55-
ruby-version: 3.3
58+
ruby-version: 4.0
5659

5760
- name: Update Gem Version
5861
run: sed -i "s/VERSION = '.*'/VERSION = '$GEM_VERSION'/g" lib/bandwidth-sdk/version.rb
@@ -64,12 +67,11 @@ jobs:
6467
prism mock ./bandwidth.yml & (sleep 3; rake unit)
6568
shell: bash
6669

70+
- name: Configure Rubygems Trusted Publishing Credentials
71+
uses: rubygems/configure-rubygems-credentials@v2.1.0
72+
6773
- name: Deploy to Rubygems
6874
run: |
69-
mkdir ~/.gem
70-
touch ~/.gem/credentials
71-
chmod 0600 ~/.gem/credentials
72-
printf -- "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials
7375
gem build *.gemspec
7476
gem push *.gem
7577

‎.github/workflows/test-pr.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ jobs:
3333
runs-on: ${{ matrix.os }}
3434
strategy:
3535
matrix:
36-
os: [windows-2022, windows-2025, ubuntu-22.04, ubuntu-24.04]
37-
ruby-version: ['3.0','3.1','3.2','3.3']
36+
os: [windows-2022, windows-2025, ubuntu-22.04, ubuntu-24.04]
37+
ruby-version: ["3.2", "3.3", "3.4", "4.0"]
3838
fail-fast: false
3939
steps:
4040
- name: Checkout
41-
uses: actions/checkout@v5
41+
uses: actions/checkout@v7
4242

4343
- name: Set up Ruby
4444
uses: ruby/setup-ruby@v1

‎.github/workflows/test-smoke.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ jobs:
3737
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
3838
steps:
3939
- name: Checkout
40-
uses: actions/checkout@v5
40+
uses: actions/checkout@v7
4141

4242
- name: Set up Ruby
4343
uses: ruby/setup-ruby@v1
4444
with:
45-
ruby-version: 3.3
45+
ruby-version: 3.4
4646

4747
- name: Install Packages and Test
4848
run: |
4949
bundle install
5050
rake smoke
5151
env:
52-
RUBY_VERSION: 3.3
52+
RUBY_VERSION: 3.4
5353
OPERATING_SYSTEM: ubuntu
5454
shell: bash
5555

@@ -66,19 +66,19 @@ jobs:
6666
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_UP_APPLICATION_ID }}
6767
steps:
6868
- name: Checkout
69-
uses: actions/checkout@v4
69+
uses: actions/checkout@v7
7070

7171
- name: Set up Ruby
7272
uses: ruby/setup-ruby@v1
7373
with:
74-
ruby-version: 3.3
74+
ruby-version: 3.4
7575

7676
- name: Install Packages and Test
7777
run: |
7878
bundle install
7979
rake smoke
8080
env:
81-
RUBY_VERSION: 3.3
81+
RUBY_VERSION: 3.4
8282
OPERATING_SYSTEM: ubuntu
8383
shell: bash
8484

‎.openapi-generator/FILES‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ docs/RecordingTranscriptions.md
170170
docs/RecordingsApi.md
171171
docs/RedirectCallback.md
172172
docs/RedirectMethodEnum.md
173+
docs/ReferCallStatusEnum.md
174+
docs/ReferCompleteCallback.md
173175
docs/SipConnectionMetadata.md
174176
docs/SipCredentials.md
175177
docs/SmsMessageContent.md
@@ -390,6 +392,8 @@ lib/bandwidth-sdk/models/recording_transcription_metadata.rb
390392
lib/bandwidth-sdk/models/recording_transcriptions.rb
391393
lib/bandwidth-sdk/models/redirect_callback.rb
392394
lib/bandwidth-sdk/models/redirect_method_enum.rb
395+
lib/bandwidth-sdk/models/refer_call_status_enum.rb
396+
lib/bandwidth-sdk/models/refer_complete_callback.rb
393397
lib/bandwidth-sdk/models/sip_connection_metadata.rb
394398
lib/bandwidth-sdk/models/sip_credentials.rb
395399
lib/bandwidth-sdk/models/sms_message_content.rb

‎.openapi-generator/VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.17.0
1+
7.24.0

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ Class | Method | HTTP request | Description
333333
- [Bandwidth::RecordingTranscriptions](docs/RecordingTranscriptions.md)
334334
- [Bandwidth::RedirectCallback](docs/RedirectCallback.md)
335335
- [Bandwidth::RedirectMethodEnum](docs/RedirectMethodEnum.md)
336+
- [Bandwidth::ReferCallStatusEnum](docs/ReferCallStatusEnum.md)
337+
- [Bandwidth::ReferCompleteCallback](docs/ReferCompleteCallback.md)
336338
- [Bandwidth::SipConnectionMetadata](docs/SipConnectionMetadata.md)
337339
- [Bandwidth::SipCredentials](docs/SipCredentials.md)
338340
- [Bandwidth::SmsMessageContent](docs/SmsMessageContent.md)

‎UPDATING_MODEL_TESTS.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ describe Bandwidth::ModelName do
4848

4949
describe '#to_s' do
5050
# Use the *populated* values instance, not the empty default.
51+
# Compare against a hash literal + .to_s, never a hardcoded string.
5152
it 'returns a string representation of the object'
5253
end
5354

@@ -293,9 +294,23 @@ Bandwidth::VerificationRequest.build_from_hash({
293294

294295
Apply this recursively — if the nested model itself has nested models with required attrs, fill those too. Check the nested model's setters (`def <attr>=` blocks raising `'<attr> cannot be nil'`) to know which attrs are required.
295296

296-
### `#to_s` is sensitive to attribute order
297+
### `#to_s` must not assert against a hardcoded string
297298

298-
The expected string must match the exact order of attributes as serialized by `to_hash`. Generate the expected string by running the populated instance through `to_s` in a console and pasting the result. Don't hand-craft it.
299+
`ApiModelBase#to_s` is `to_hash.to_s`, so its output is whatever `Hash#inspect` produces on the running Ruby — and **that format is version-dependent**. Ruby 3.4 changed it from `{:key=>"value"}` to `{key: "value"}`, which broke every spec that pasted a literal string.
300+
301+
Compare against a **hash literal put through `.to_s`** instead. Ruby renders both sides with the same format, so the assertion holds on every supported version:
302+
303+
```ruby
304+
# Wrong — passes on <= 3.3, fails on >= 3.4:
305+
expect(model_values.to_s).to eq('{:type=>"validation", :id=>"abc"}')
306+
307+
# Right — version-agnostic:
308+
expect(model_values.to_s).to eq({:type=>"validation", :id=>"abc"}.to_s)
309+
```
310+
311+
The auto-generated spec emits the hardcoded-string form, so this needs fixing on every regeneration. The fix is mechanical: strip the surrounding quotes and append `.to_s` — the text inside the quotes is already valid Ruby hash-literal source.
312+
313+
**Attribute order still matters.** String comparison is order-sensitive (unlike the `Hash#==` in the `#to_body #to_hash` block), so the literal's key order must match `to_hash`'s serialization order. Keys are the *JSON* names from `attribute_map` (camelCase), not the snake_case attr names. Get the order by running the populated instance through `to_s` in a console — just convert the result to a hash literal rather than pasting it as a string.
299314

300315
### Nullable attribute symbols
301316

‎bandwidth-sdk.gemspec‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
The version of the OpenAPI document: 1.0.0
99
Contact: letstalk@bandwidth.com
1010
Generated by: https://openapi-generator.tech
11-
Generator version: 7.17.0
11+
Generator version: 7.24.0
1212
=end
1313

1414
$:.push File.expand_path('../lib', __FILE__)
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
2929

3030
s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
3131
s.add_runtime_dependency 'faraday-multipart'
32-
s.add_runtime_dependency 'ox', '~> 2.14'
32+
s.add_runtime_dependency 'ox', '~> 2.14', '>= 2.14.28'
3333
s.add_runtime_dependency 'marcel'
3434

3535
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'

0 commit comments

Comments
 (0)