Skip to content

Commit

Permalink
feat!: Merge '7.0.0-rc' into main (#719)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: sbansla <[email protected]>
Co-authored-by: Twilio <[email protected]>
  • Loading branch information
4 people authored Mar 26, 2024
1 parent 09f41ae commit d96b00a
Show file tree
Hide file tree
Showing 138 changed files with 2,511 additions and 681 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
- name: Run Cluster Test
if: (!github.event.pull_request.head.repo.fork)
env:
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}}
TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }}
TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }}
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}}
TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }}
TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }}
run: make cluster-test

- name: Fix code coverage paths
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
twilio-ruby changelog
=====================
=====================

[2024-03-12] Version 6.12.1
---------------------------
Expand Down
11 changes: 11 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
_After `5.0.0` all `MINOR` and `MAJOR` version bumps will have upgrade notes
posted here._

[2024-01-19] 6.x.x to 7.x.x
-----------------------------
### Overview

##### 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

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.
We're pleased to inform you that version 7.0.0 adds support for the application/json content type in the request body.

To learn more about the Ruby Helper Library, check out [our docs](https://www.twilio.com/docs/libraries/ruby).

[2023-05-03] 5.x.x to 6.x.x
-----------------------------
### Overview
Expand Down
9 changes: 8 additions & 1 deletion lib/twilio-ruby/framework/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ def to_s
data = ''
unless @data.nil? || @data.empty?
data = @method.equal?('GET') ? "\n -G" : "\n"
data += @data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
data += case @headers['Content-Type']
when 'application/x-www-form-urlencoded'
@data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
when 'application/json'
"-d '#{JSON.generate(@data)}'"
else
@data.each.map { |key, value| "-d \"#{key}\"=\"#{value}\"" }.join("\n")
end
end

"#{auth} #{@method} #{@url}#{params}#{data}#{headers}"
Expand Down
13 changes: 10 additions & 3 deletions lib/twilio-ruby/http/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ class Client
attr_reader :timeout, :last_response, :last_request, :connection

def initialize(proxy_prot = nil, proxy_addr = nil, proxy_port = nil, proxy_user = nil, proxy_pass = nil,
ssl_ca_file = nil, timeout: nil)
timeout: nil)
@proxy_prot = proxy_prot
@proxy_path = "#{proxy_addr}:#{proxy_port}" if proxy_addr && proxy_port
@proxy_auth = "#{proxy_user}:#{proxy_pass}@" if proxy_pass && proxy_user
@ssl_ca_file = ssl_ca_file
@timeout = timeout
@adapter = Faraday.default_adapter
@configure_connection_blocks = []
Expand All @@ -27,9 +26,17 @@ def configure_connection(&block)
end

def _request(request) # rubocop:disable Metrics/MethodLength
middle_ware = case request.headers['Content-Type']
when 'application/json'
:json
when 'application/x-www-form-urlencoded'
:url_encoded
else
:url_encoded
end
@connection = Faraday.new(url: request.host + ':' + request.port.to_s, ssl: { verify: true }) do |f|
f.options.params_encoder = Faraday::FlatParamsEncoder
f.request :url_encoded
f.request(middle_ware)
f.headers = request.headers
if Faraday::VERSION.start_with?('2.')
f.request(:authorization, :basic, request.auth[0], request.auth[1])
Expand Down
2 changes: 0 additions & 2 deletions lib/twilio-ruby/rest/api/v2010/account/call/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ def to_s
end


##
#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 [email protected].
class PaymentContext < InstanceContext
##
# Initialize the PaymentContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ def to_s
end


##
#PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
class AssignedAddOnContext < InstanceContext
##
# Initialize the AssignedAddOnContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ def to_s
end


##
#PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
class AssignedAddOnExtensionContext < InstanceContext
##
# Initialize the AssignedAddOnExtensionContext
Expand Down
9 changes: 9 additions & 0 deletions lib/twilio-ruby/rest/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def lookups
@lookups ||= Lookups.new self
end
##
# Access the PreviewMessaging Twilio Domain
def preview_messaging
@preview_messaging ||= PreviewMessaging.new self
end
##
# Access the Messaging Twilio Domain
def messaging
Expand All @@ -108,6 +112,11 @@ def numbers
@numbers ||= Numbers.new self
end
##
# Access the Oauth Twilio Domain
def oauth
@oauth ||= Oauth.new self
end
##
# Access the Preview Twilio Domain
def preview
@preview ||= Preview.new self
Expand Down
Loading

0 comments on commit d96b00a

Please sign in to comment.