-
Notifications
You must be signed in to change notification settings - Fork 471
fix: Regional API domain processing #765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
1126073
2ae48ae
48dac8e
17f36ef
dd656f4
4e4b1b8
86f84f4
9c59209
b5dbfe1
f2e6ade
ceb2582
19ef793
f438b4b
0b186ad
4cddb05
8cb0b4f
bdf1b93
7a53506
b8142a9
1787d5d
874ac88
3e08521
a4630a6
b22181c
1ebcbdb
da128d9
596c002
51300b5
87a98e6
d77d0a3
8f52d3b
5243245
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,9 +3,20 @@ module REST | |||||||||||||||||||||
| class ClientBase | ||||||||||||||||||||||
| # rubocop:disable Style/ClassVars | ||||||||||||||||||||||
| @@default_region = 'us1' | ||||||||||||||||||||||
| @@region_mappings = { | ||||||||||||||||||||||
| 'au1' => 'sydney', | ||||||||||||||||||||||
| 'br1' => 'sao-paulo', | ||||||||||||||||||||||
| 'de1' => 'frankfurt', | ||||||||||||||||||||||
| 'ie1' => 'dublin', | ||||||||||||||||||||||
| 'jp1' => 'tokyo', | ||||||||||||||||||||||
| 'jp2' => 'osaka', | ||||||||||||||||||||||
| 'sg1' => 'singapore', | ||||||||||||||||||||||
| 'us1' => 'ashburn', | ||||||||||||||||||||||
| 'us2' => 'umatilla' | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| # rubocop:enable Style/ClassVars | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region, :edge, :logger, | ||||||||||||||||||||||
| attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region, :logger, | ||||||||||||||||||||||
| :user_agent_extensions, :credentials | ||||||||||||||||||||||
manisha1997 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # rubocop:disable Metrics/ParameterLists | ||||||||||||||||||||||
|
|
@@ -14,7 +25,7 @@ def initialize(username = nil, password = nil, account_sid = nil, region = nil, | |||||||||||||||||||||
| @username = username || Twilio.account_sid | ||||||||||||||||||||||
| @password = password || Twilio.auth_token | ||||||||||||||||||||||
| @region = region || Twilio.region | ||||||||||||||||||||||
| @edge = Twilio.edge | ||||||||||||||||||||||
| @edge = !region.nil? ? @@region_mappings[region] : nil | ||||||||||||||||||||||
|
||||||||||||||||||||||
| @edge = !region.nil? ? @@region_mappings[region] : nil | |
| if @region && @@region_mappings[@region] | |
| @edge = @@region_mappings[@region] | |
| elsif Twilio.edge | |
| warn '[DEPRECATION] Setting edge via Twilio.edge is deprecated. Use Twilio.region instead.' | |
| @edge = Twilio.edge | |
| else | |
| warn "[WARN] Region '#{@region}' is not mapped to an edge. @edge set to nil." unless @region.nil? | |
| @edge = nil | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Uh oh!
There was an error while loading. Please reload this page.