Skip to content

Commit

Permalink
update ruby snippets due to changes in capped-chain
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Oliveros <[email protected]>
  • Loading branch information
joliveros committed Jul 9, 2018
1 parent 3bd8a0a commit d39511b
Show file tree
Hide file tree
Showing 352 changed files with 1,403 additions and 977 deletions.
3 changes: 2 additions & 1 deletion accounts/v1/aws/create-default/create-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

aws = @client.accounts.credentials.aws
aws = @client.accounts.credentials
.aws
.create(
credentials: 'AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
)
Expand Down
5 changes: 3 additions & 2 deletions accounts/v1/aws/fetch-default/fetch-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

aws = @client.accounts.credentials.aws('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch
aws = @client.accounts.credentials
.aws('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch

puts aws.friendly_name
5 changes: 3 additions & 2 deletions accounts/v1/aws/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

aws = @client.accounts.credentials.aws('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')
aws = @client.accounts.credentials
.aws('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')

puts aws.friendly_name
5 changes: 3 additions & 2 deletions accounts/v1/public_key/delete-default/delete-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client.accounts.credentials.public_key('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.delete
@client.accounts.credentials
.public_key('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.delete
7 changes: 4 additions & 3 deletions accounts/v1/public_key/fetch-default/fetch-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

public_key = @client.accounts.credentials
.public_key('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch
public_key = @client.accounts
.credentials
.public_key('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch

puts public_key.friendly_name
7 changes: 4 additions & 3 deletions accounts/v1/public_key/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

public_key = @client.accounts.credentials
.public_key('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')
public_key = @client.accounts
.credentials
.public_key('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')

puts public_key.friendly_name
11 changes: 6 additions & 5 deletions api/v2010/feedback_summary/create-default/create-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

feedback_summary = @client.calls.feedback_summaries
.create(
start_date: Date.new(2008, 1, 2),
end_date: Date.new(2008, 1, 2)
)
feedback_summary = @client.calls
.feedback_summaries
.create(
start_date: Date.new(2008, 1, 2),
end_date: Date.new(2008, 1, 2)
)

puts feedback_summary.sid
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

ip_access_control_list = @client.sip.ip_access_control_lists
.create(friendly_name: 'friendly_name')
ip_access_control_list = @client.sip
.ip_access_control_lists
.create(friendly_name: 'friendly_name')

puts ip_access_control_list.sid
5 changes: 3 additions & 2 deletions api/v2010/machine_to_machine/read-default/read-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

machine_to_machine = @client.available_phone_numbers('US').machine_to_machine
.list
machine_to_machine = @client.available_phone_numbers('US')
.machine_to_machine
.list

machine_to_machine.each do |record|
puts record.friendly_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

participant = @client.conferences('AgentConf12').participants
.create(
from: '+18180021216',
to: '+15624421212'
)
participant = @client.conferences('AgentConf12')
.participants
.create(from: '+18180021216', to: '+15624421212')

puts participant.call_sid
14 changes: 14 additions & 0 deletions api/v2010/recording/create-default/create-default.5.x.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

recording = @client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.recordings
.create

puts recording.sid
17 changes: 17 additions & 0 deletions api/v2010/recording/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

recording = @client.conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(
pause_behavior: 'pause_behavior',
status: 'in-progress'
)

puts recording.call_sid
5 changes: 3 additions & 2 deletions api/v2010/toll_free/create-default/create-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

toll_free = @client.incoming_phone_numbers.toll_free
.create(phone_number: '+15017122661')
toll_free = @client.incoming_phone_numbers
.toll_free
.create(phone_number: '+15017122661')

puts toll_free.sid
7 changes: 4 additions & 3 deletions chat/v1/channel/create-default/create-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

channel = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels
.create
channel = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels
.create

puts channel.sid
7 changes: 4 additions & 3 deletions chat/v1/channel/fetch-default/fetch-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

channel = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch
channel = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch

puts channel.friendly_name
7 changes: 4 additions & 3 deletions chat/v1/channel/read-default/read-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

channels = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels
.list
channels = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels
.list

channels.each do |record|
puts record.sid
Expand Down
7 changes: 4 additions & 3 deletions chat/v1/channel/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

channel = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')
channel = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')

puts channel.friendly_name
6 changes: 4 additions & 2 deletions chat/v1/credential/fetch-default/fetch-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

credential = @client.chat.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch
credential = @client.chat
.v1
.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch

puts credential.friendly_name
6 changes: 4 additions & 2 deletions chat/v1/credential/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

credential = @client.chat.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')
credential = @client.chat
.v1
.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')

puts credential.friendly_name
9 changes: 5 additions & 4 deletions chat/v1/invite/read-default/read-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

invites = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.invites
.list
invites = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.invites
.list

invites.each do |record|
puts record.sid
Expand Down
9 changes: 5 additions & 4 deletions chat/v1/member/read-default/read-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

members = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.members
.list
members = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.members
.list

members.each do |record|
puts record.sid
Expand Down
9 changes: 5 additions & 4 deletions chat/v1/message/create-default/create-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

message = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages
.create(body: 'body')
message = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages
.create(body: 'body')

puts message.sid
9 changes: 5 additions & 4 deletions chat/v1/message/fetch-default/fetch-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

message = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages('IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch
message = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages('IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch

puts message.to
9 changes: 5 additions & 4 deletions chat/v1/message/read-default/read-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

messages = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages
.list
messages = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages
.list

messages.each do |record|
puts record.sid
Expand Down
9 changes: 5 additions & 4 deletions chat/v1/message/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

message = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages('IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(body: 'body')
message = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.messages('IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(body: 'body')

puts message.to
5 changes: 3 additions & 2 deletions chat/v1/service/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

service = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')
service = @client.chat.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')

puts service.friendly_name
10 changes: 6 additions & 4 deletions chat/v1/user_channel/read-default/read-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

user_channels = @client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.user_channels
.list
user_channels = @client.chat
.v1
.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.user_channels
.list

user_channels.each do |record|
puts record.service_sid
Expand Down
5 changes: 3 additions & 2 deletions chat/v2/credential/fetch-default/fetch-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

credential = @client.chat.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch
credential = @client.chat
.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch

puts credential.friendly_name
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

credential = @client.chat.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch
credential = @client.chat
.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.fetch

puts credential.friendly_name
5 changes: 3 additions & 2 deletions chat/v2/credential/update-default/update-default.5.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

credential = @client.chat.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')
credential = @client.chat
.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update(friendly_name: 'friendly_name')

puts credential.friendly_name
Loading

0 comments on commit d39511b

Please sign in to comment.