Skip to content

Commit

Permalink
Add exchanging-numbers ruby 5.x snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
hortega committed Sep 26, 2017
1 parent dc0f6ae commit 5bc5a74
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Twilio::REST::Client.new account_sid, auth_token

# In the case you want to transfer numbers between subaccounts, you need to
# know three things - the account SID of the phone number's current owner,
# the account SID of the account you'd like to transfer the number to, and
# the SID of the phone number you'd like to transfer
current_owner_sid = 'ACyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
new_owner_sid = 'ACzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
phone_number_sid = 'PNyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'

# Update the number
number = client.api.v2010.accounts(current_owner_sid)
.incoming_phone_numbers(phone_number_sid)
.fetch
number.update(account_sid: new_owner_sid)
puts number.phone_number
2 changes: 1 addition & 1 deletion tools/snippet-testing/model/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Dependency
CSHARP_NAME => ['4.x', CS_V5],
PHP_NAME => ['4.10', '5.14.1'],
PYTHON_NAME => ['5.6.0', '6.6.3'],
RUBY_NAME => ['4.13.0', '5.2.2'],
RUBY_NAME => ['4.13.0', '5.2.3'],
NODE_NAME => ['2.11.0', '3.6.7'],
JAVA6_NAME => { group: 'com.twilio.sdk', name: 'twilio-java-sdk', version: '6.3.0', suffix: '-jar-with-dependencies' },
JAVA7_NAME => { group: 'com.twilio.sdk', name: 'twilio', version: '7.14.5', suffix: '-jar-with-dependencies' }
Expand Down

0 comments on commit 5bc5a74

Please sign in to comment.