Skip to content

Commit d96b00a

Browse files
tiwarishubham635manisha1997sbanslatwilio-dx
authored
feat!: Merge '7.0.0-rc' into main (#719)
* chore: add domain detail (#705) * chore: set middleware for json type (#706) * chore: add changelogs information (#707) * chore: add changelogs information * chore: add changelogs information * chore: add changelogs information * chore: add changelogs information * chore: add changelogs information * chore: removed ssl ca file from http client (#709) * disable-cluster-test (#711) * chore: enable cluster test (#714) * feat!: MVR preparation (#717) * chore: sync with main --------- Co-authored-by: Manisha Singh <singhmanisha.250025@gmail.com> Co-authored-by: sbansla <104902068+sbansla@users.noreply.github.com> Co-authored-by: Twilio <team_interfaces+github@twilio.com>
1 parent 09f41ae commit d96b00a

File tree

138 files changed

+2511
-681
lines changed

Some content is hidden

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

138 files changed

+2511
-681
lines changed

.github/workflows/test-and-deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848
- name: Run Cluster Test
4949
if: (!github.event.pull_request.head.repo.fork)
5050
env:
51-
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
52-
TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}}
53-
TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }}
54-
TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
55-
TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }}
51+
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
52+
TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}}
53+
TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }}
54+
TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
55+
TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }}
5656
run: make cluster-test
5757

5858
- name: Fix code coverage paths

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
twilio-ruby changelog
2-
=====================
2+
=====================
33

44
[2024-03-12] Version 6.12.1
55
---------------------------

UPGRADE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
_After `5.0.0` all `MINOR` and `MAJOR` version bumps will have upgrade notes
44
posted here._
55

6+
[2024-01-19] 6.x.x to 7.x.x
7+
-----------------------------
8+
### Overview
9+
10+
##### Twilio Ruby Helper Library’s major version 7.0.0 is now available. We ensured that you can upgrade to Ruby helper Library 7.0.0 version without any breaking changes of existing apis
11+
12+
Behind the scenes Ruby Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages.
13+
We're pleased to inform you that version 7.0.0 adds support for the application/json content type in the request body.
14+
15+
To learn more about the Ruby Helper Library, check out [our docs](https://www.twilio.com/docs/libraries/ruby).
16+
617
[2023-05-03] 5.x.x to 6.x.x
718
-----------------------------
819
### Overview

lib/twilio-ruby/framework/request.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ def to_s
3232
data = ''
3333
unless @data.nil? || @data.empty?
3434
data = @method.equal?('GET') ? "\n -G" : "\n"
35-
data += @data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
35+
data += case @headers['Content-Type']
36+
when 'application/x-www-form-urlencoded'
37+
@data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
38+
when 'application/json'
39+
"-d '#{JSON.generate(@data)}'"
40+
else
41+
@data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
42+
end
3643
end
3744

3845
"#{auth} #{@method} #{@url}#{params}#{data}#{headers}"

lib/twilio-ruby/http/http_client.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ class Client
99
attr_reader :timeout, :last_response, :last_request, :connection
1010

1111
def initialize(proxy_prot = nil, proxy_addr = nil, proxy_port = nil, proxy_user = nil, proxy_pass = nil,
12-
ssl_ca_file = nil, timeout: nil)
12+
timeout: nil)
1313
@proxy_prot = proxy_prot
1414
@proxy_path = "#{proxy_addr}:#{proxy_port}" if proxy_addr && proxy_port
1515
@proxy_auth = "#{proxy_user}:#{proxy_pass}@" if proxy_pass && proxy_user
16-
@ssl_ca_file = ssl_ca_file
1716
@timeout = timeout
1817
@adapter = Faraday.default_adapter
1918
@configure_connection_blocks = []
@@ -27,9 +26,17 @@ def configure_connection(&block)
2726
end
2827

2928
def _request(request) # rubocop:disable Metrics/MethodLength
29+
middle_ware = case request.headers['Content-Type']
30+
when 'application/json'
31+
:json
32+
when 'application/x-www-form-urlencoded'
33+
:url_encoded
34+
else
35+
:url_encoded
36+
end
3037
@connection = Faraday.new(url: request.host + ':' + request.port.to_s, ssl: { verify: true }) do |f|
3138
f.options.params_encoder = Faraday::FlatParamsEncoder
32-
f.request :url_encoded
39+
f.request(middle_ware)
3340
f.headers = request.headers
3441
if Faraday::VERSION.start_with?('2.')
3542
f.request(:authorization, :basic, request.auth[0], request.auth[1])

lib/twilio-ruby/rest/api/v2010/account/call/payment.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ def to_s
110110
end
111111

112112

113-
##
114-
#PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
115113
class PaymentContext < InstanceContext
116114
##
117115
# Initialize the PaymentContext

lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ def to_s
149149
end
150150

151151

152-
##
153-
#PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
154152
class AssignedAddOnContext < InstanceContext
155153
##
156154
# Initialize the AssignedAddOnContext

lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ def to_s
128128
end
129129

130130

131-
##
132-
#PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
133131
class AssignedAddOnExtensionContext < InstanceContext
134132
##
135133
# Initialize the AssignedAddOnExtensionContext

lib/twilio-ruby/rest/client.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def lookups
8282
@lookups ||= Lookups.new self
8383
end
8484
##
85+
# Access the PreviewMessaging Twilio Domain
86+
def preview_messaging
87+
@preview_messaging ||= PreviewMessaging.new self
88+
end
8589
##
8690
# Access the Messaging Twilio Domain
8791
def messaging
@@ -108,6 +112,11 @@ def numbers
108112
@numbers ||= Numbers.new self
109113
end
110114
##
115+
# Access the Oauth Twilio Domain
116+
def oauth
117+
@oauth ||= Oauth.new self
118+
end
119+
##
111120
# Access the Preview Twilio Domain
112121
def preview
113122
@preview ||= Preview.new self

0 commit comments

Comments
 (0)