twilio-ruby 3.16.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/CHANGES.md +10 -0
- data/README.md +1 -1
- data/lib/twilio-ruby/rest/base_client.rb +17 -30
- data/lib/twilio-ruby/rest/client.rb +2 -0
- data/lib/twilio-ruby/rest/list_resource.rb +8 -14
- data/lib/twilio-ruby/rest/lookups_client.rb +2 -20
- data/lib/twilio-ruby/rest/next_gen_list_resource.rb +7 -0
- data/lib/twilio-ruby/rest/sms/messages.rb +0 -1
- data/lib/twilio-ruby/rest/task_router/statistics.rb +26 -0
- data/lib/twilio-ruby/rest/task_router/task_queues.rb +11 -2
- data/lib/twilio-ruby/rest/task_router/workers.rb +7 -2
- data/lib/twilio-ruby/rest/task_router/workflows.rb +4 -1
- data/lib/twilio-ruby/rest/task_router/workspaces.rb +2 -0
- data/lib/twilio-ruby/rest/task_router_client.rb +20 -47
- data/lib/twilio-ruby/util/client_config.rb +29 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/lib/twilio-ruby.rb +2 -0
- data/spec/rest/sms/messages_spec.rb +1 -6
- data/spec/util/client_config_spec.rb +21 -0
- data/spec/util/configuration_spec.rb +2 -0
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
OTVlYzExOGM0MDgwMzg3NmE4MTM0M2M1MjAyNTY1MmU5Yjk3NjY1Mw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MTBlYzkxM2NjYjViMzY2OGU5NzUyMjBhMjNjOGQ5ZWVmN2I5YTdjYw==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Mjk0ZDNjYjIwYTc2NjZiYjAzNmM4NGQ4NWQ4NWJlNGM0NzA2NTI5NmI1OTI4
|
|
10
|
+
Y2E5ZDEzYzQ0MjNiNTEzM2Y0MWQ5MzBiMTFiM2MwNThmODNjMjY4NmE2MTdi
|
|
11
|
+
MDM4NWY3OWU0ZGY1NWI4YjU2MTM4NzRiZTRjNmQ4MzNjZDEyOWU=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ODBhZjRmYWQ4ZTU3MTA3ZjE5MjEyNjYyODI2ZDk0Njk3Mjg3YjRjYTgyYTA4
|
|
14
|
+
NGEyMjExNzUzYjhjMGE3ZWM1YmI2MzM4YThmOGEwNGRkZTZmNzc5ZmMwMjli
|
|
15
|
+
OTNkMmE3YjY2NmIxZjRkZGRmMTc3OWE3NmM2ZjE5MGJmOTViN2E=
|
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
twilio-ruby changelog
|
|
2
2
|
=====================
|
|
3
3
|
|
|
4
|
+
Version 4.0.0
|
|
5
|
+
-------------
|
|
6
|
+
|
|
7
|
+
Released April 16, 2015
|
|
8
|
+
|
|
9
|
+
- Remove support for total
|
|
10
|
+
- Use configuration object instead of defaults hash for REST clients
|
|
11
|
+
- Moves statistics from task router client to individual classes
|
|
12
|
+
- Deprecates statistics methods on task router client
|
|
13
|
+
|
|
4
14
|
Version 3.16.1
|
|
5
15
|
--------------
|
|
6
16
|
|
data/README.md
CHANGED
|
@@ -11,7 +11,7 @@ A module for using the Twilio REST API and generating valid [TwiML](http://www.t
|
|
|
11
11
|
To install using [Bundler][bundler] grab the latest stable version:
|
|
12
12
|
|
|
13
13
|
```ruby
|
|
14
|
-
gem 'twilio-ruby', '~>
|
|
14
|
+
gem 'twilio-ruby', '~> 4.0.0'
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
|
@@ -12,25 +12,19 @@ module Twilio
|
|
|
12
12
|
" #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL})"
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
timeout: 30,
|
|
22
|
-
proxy_addr: nil,
|
|
23
|
-
proxy_port: nil,
|
|
24
|
-
proxy_user: nil,
|
|
25
|
-
proxy_pass: nil,
|
|
26
|
-
retry_limit: 1
|
|
27
|
-
}
|
|
15
|
+
##
|
|
16
|
+
# Override the default host for a REST Client (api.twilio.com)
|
|
17
|
+
def self.host(host=nil)
|
|
18
|
+
return @host unless host
|
|
19
|
+
@host = host
|
|
20
|
+
end
|
|
28
21
|
|
|
29
22
|
attr_reader :account_sid, :last_request, :last_response
|
|
30
23
|
|
|
31
24
|
def initialize(*args)
|
|
32
25
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
|
33
|
-
|
|
26
|
+
options[:host] ||= self.class.host
|
|
27
|
+
@config = Twilio::Util::ClientConfig.new options
|
|
34
28
|
|
|
35
29
|
@account_sid = args[0] || Twilio.account_sid
|
|
36
30
|
@auth_token = args[1] || Twilio.auth_token
|
|
@@ -63,13 +57,6 @@ module Twilio
|
|
|
63
57
|
|
|
64
58
|
protected
|
|
65
59
|
|
|
66
|
-
##
|
|
67
|
-
# Get the default config values.
|
|
68
|
-
def get_defaults
|
|
69
|
-
# To be overridden
|
|
70
|
-
DEFAULTS
|
|
71
|
-
end
|
|
72
|
-
|
|
73
60
|
##
|
|
74
61
|
# Builds up full request path
|
|
75
62
|
# Needs implementation in child classes
|
|
@@ -81,22 +68,22 @@ module Twilio
|
|
|
81
68
|
# Set up and cache a Net::HTTP object to use when making requests. This is
|
|
82
69
|
# a private method documented for completeness.
|
|
83
70
|
def set_up_connection # :doc:
|
|
84
|
-
connection_class = Net::HTTP::Proxy @config
|
|
85
|
-
@config
|
|
86
|
-
@connection = connection_class.new @config
|
|
71
|
+
connection_class = Net::HTTP::Proxy @config.proxy_addr,
|
|
72
|
+
@config.proxy_port, @config.proxy_user, @config.proxy_pass
|
|
73
|
+
@connection = connection_class.new @config.host, @config.port
|
|
87
74
|
set_up_ssl
|
|
88
|
-
@connection.open_timeout = @config
|
|
89
|
-
@connection.read_timeout = @config
|
|
75
|
+
@connection.open_timeout = @config.timeout
|
|
76
|
+
@connection.read_timeout = @config.timeout
|
|
90
77
|
end
|
|
91
78
|
|
|
92
79
|
##
|
|
93
80
|
# Set up the ssl properties of the <tt>@connection</tt> Net::HTTP object.
|
|
94
81
|
# This is a private method documented for completeness.
|
|
95
82
|
def set_up_ssl # :doc:
|
|
96
|
-
@connection.use_ssl = @config
|
|
97
|
-
if @config
|
|
83
|
+
@connection.use_ssl = @config.use_ssl
|
|
84
|
+
if @config.ssl_verify_peer
|
|
98
85
|
@connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
99
|
-
@connection.ca_file = @config
|
|
86
|
+
@connection.ca_file = @config.ssl_ca_file
|
|
100
87
|
else
|
|
101
88
|
@connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
102
89
|
end
|
|
@@ -116,7 +103,7 @@ module Twilio
|
|
|
116
103
|
# inspection later.
|
|
117
104
|
def connect_and_send(request) # :doc:
|
|
118
105
|
@last_request = request
|
|
119
|
-
retries_left = @config
|
|
106
|
+
retries_left = @config.retry_limit
|
|
120
107
|
begin
|
|
121
108
|
response = @connection.request request
|
|
122
109
|
@last_response = response
|
|
@@ -51,11 +51,17 @@ module Twilio
|
|
|
51
51
|
@instance_class.new "#{path}/#{resource[@instance_id_key]}", @client,
|
|
52
52
|
resource
|
|
53
53
|
end
|
|
54
|
-
# set the +
|
|
54
|
+
# set the +previous_page+ and +next_page+ properties on the array
|
|
55
55
|
client, list_class = @client, self.class
|
|
56
56
|
resource_list.instance_eval do
|
|
57
57
|
eigenclass = class << self; self; end
|
|
58
|
-
eigenclass.send :define_method, :
|
|
58
|
+
eigenclass.send :define_method, :previous_page, &lambda {
|
|
59
|
+
if response['previous_page_uri']
|
|
60
|
+
list_class.new(response['previous_page_uri'], client).list({}, true)
|
|
61
|
+
else
|
|
62
|
+
[]
|
|
63
|
+
end
|
|
64
|
+
}
|
|
59
65
|
eigenclass.send :define_method, :next_page, &lambda {
|
|
60
66
|
if response['next_page_uri']
|
|
61
67
|
list_class.new(response['next_page_uri'], client).list({}, true)
|
|
@@ -67,18 +73,6 @@ module Twilio
|
|
|
67
73
|
resource_list
|
|
68
74
|
end
|
|
69
75
|
|
|
70
|
-
##
|
|
71
|
-
# Ask Twilio for the total number of items in the list.
|
|
72
|
-
# Calling this method makes an HTTP GET request to <tt>@path</tt> with a
|
|
73
|
-
# page size parameter of 1 to minimize data over the wire while still
|
|
74
|
-
# obtaining the total. Don't use this if you are planning to
|
|
75
|
-
# call #list anyway, since the array returned from #list will have a
|
|
76
|
-
# +total+ attribute as well.
|
|
77
|
-
def total
|
|
78
|
-
raise "Can't get a resource total without a REST Client" unless @client
|
|
79
|
-
@client.get(@path, page_size: 1)['total']
|
|
80
|
-
end
|
|
81
|
-
|
|
82
76
|
##
|
|
83
77
|
# Return an empty instance resource object with the proper path. Note that
|
|
84
78
|
# this will never raise a Twilio::REST::RequestError on 404 since no HTTP
|
|
@@ -4,22 +4,10 @@ module Twilio
|
|
|
4
4
|
class LookupsClient < BaseClient
|
|
5
5
|
API_VERSION = 'v1'
|
|
6
6
|
|
|
7
|
-
DEFAULTS = {
|
|
8
|
-
host: 'lookups.twilio.com',
|
|
9
|
-
port: 443,
|
|
10
|
-
use_ssl: true,
|
|
11
|
-
ssl_verify_peer: true,
|
|
12
|
-
ssl_ca_file: File.dirname(__FILE__) + '/../../../conf/cacert.pem',
|
|
13
|
-
timeout: 30,
|
|
14
|
-
proxy_addr: nil,
|
|
15
|
-
proxy_port: nil,
|
|
16
|
-
proxy_user: nil,
|
|
17
|
-
proxy_pass: nil,
|
|
18
|
-
retry_limit: 1
|
|
19
|
-
}
|
|
20
|
-
|
|
21
7
|
attr_reader :phone_numbers
|
|
22
8
|
|
|
9
|
+
host 'lookups.twilio.com'
|
|
10
|
+
|
|
23
11
|
##
|
|
24
12
|
# Instantiate a new HTTP Lookups client to talk to Twilio. The parameters
|
|
25
13
|
# +account_sid+, +auth_token+ and +workspace_sid are required, unless you
|
|
@@ -92,12 +80,6 @@ module Twilio
|
|
|
92
80
|
|
|
93
81
|
protected
|
|
94
82
|
|
|
95
|
-
##
|
|
96
|
-
# Get the default config values.
|
|
97
|
-
def get_defaults
|
|
98
|
-
DEFAULTS
|
|
99
|
-
end
|
|
100
|
-
|
|
101
83
|
##
|
|
102
84
|
# Set up +phone_numbers+ attribute.
|
|
103
85
|
def set_up_subresources # :doc:
|
|
@@ -21,6 +21,13 @@ module Twilio
|
|
|
21
21
|
[]
|
|
22
22
|
end
|
|
23
23
|
}
|
|
24
|
+
eigenclass.send :define_method, :previous_page, &lambda {
|
|
25
|
+
if response['meta']['previous_page_url']
|
|
26
|
+
list_class.new(response['meta']['previous_page_url'], client).list({})
|
|
27
|
+
else
|
|
28
|
+
[]
|
|
29
|
+
end
|
|
30
|
+
}
|
|
24
31
|
end
|
|
25
32
|
resource_list
|
|
26
33
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Twilio
|
|
2
|
+
module REST
|
|
3
|
+
module TaskRouter
|
|
4
|
+
module Statistics
|
|
5
|
+
def statistics(args={})
|
|
6
|
+
path = "#{@path}/Statistics"
|
|
7
|
+
response = @client.get(path, args, true)
|
|
8
|
+
statistics_class.new(path, @client, response)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
# Gets the class for the statistics of the current class.
|
|
15
|
+
# Should just be Object.const_get("#{self.class.to_s}Statistics") but
|
|
16
|
+
# Ruby 1.9.3 did not agree. Can be updated if support is dropped.
|
|
17
|
+
def statistics_class
|
|
18
|
+
current_class = self.class.to_s.split('::').last
|
|
19
|
+
statistics_class = Twilio::REST::TaskRouter.const_get(
|
|
20
|
+
"#{current_class}Statistics"
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
module Twilio
|
|
2
2
|
module REST
|
|
3
3
|
module TaskRouter
|
|
4
|
-
class TaskQueues < Twilio::REST::NextGenListResource
|
|
5
|
-
|
|
4
|
+
class TaskQueues < Twilio::REST::NextGenListResource
|
|
5
|
+
def statistics(args={})
|
|
6
|
+
path = "#{@path}/Statistics"
|
|
7
|
+
stats = Twilio::REST::TaskRouter::TaskQueuesStatistics.new path, @client
|
|
8
|
+
stats.list args, true
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class TaskQueue < InstanceResource
|
|
13
|
+
include Statistics
|
|
14
|
+
end
|
|
6
15
|
end
|
|
7
16
|
end
|
|
8
17
|
end
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
module Twilio
|
|
2
2
|
module REST
|
|
3
3
|
module TaskRouter
|
|
4
|
-
class Workers < Twilio::REST::NextGenListResource
|
|
5
|
-
|
|
4
|
+
class Workers < Twilio::REST::NextGenListResource
|
|
5
|
+
include Twilio::REST::TaskRouter::Statistics
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class Worker < InstanceResource
|
|
9
|
+
include Twilio::REST::TaskRouter::Statistics
|
|
10
|
+
end
|
|
6
11
|
end
|
|
7
12
|
end
|
|
8
13
|
end
|
|
@@ -4,22 +4,10 @@ module Twilio
|
|
|
4
4
|
class TaskRouterClient < BaseClient
|
|
5
5
|
API_VERSION = 'v1'
|
|
6
6
|
|
|
7
|
-
DEFAULTS = {
|
|
8
|
-
host: 'taskrouter.twilio.com',
|
|
9
|
-
port: 443,
|
|
10
|
-
use_ssl: true,
|
|
11
|
-
ssl_verify_peer: true,
|
|
12
|
-
ssl_ca_file: File.dirname(__FILE__) + '/../../../conf/cacert.pem',
|
|
13
|
-
timeout: 30,
|
|
14
|
-
proxy_addr: nil,
|
|
15
|
-
proxy_port: nil,
|
|
16
|
-
proxy_user: nil,
|
|
17
|
-
proxy_pass: nil,
|
|
18
|
-
retry_limit: 1
|
|
19
|
-
}
|
|
20
|
-
|
|
21
7
|
attr_reader :workspace, :workspace_sid, :workspaces
|
|
22
8
|
|
|
9
|
+
host 'taskrouter.twilio.com'
|
|
10
|
+
|
|
23
11
|
##
|
|
24
12
|
# Instantiate a new HTTP TaskRouter client to talk to Twilio. The parameters
|
|
25
13
|
# +account_sid+, +auth_token+ and +workspace_sid are required, unless you
|
|
@@ -121,68 +109,53 @@ module Twilio
|
|
|
121
109
|
##
|
|
122
110
|
# Get statistics of a task queue.
|
|
123
111
|
def task_queue_statistics(task_queue_sid, *args) # :doc:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
path = "/#{API_VERSION}/Workspaces/#{@workspace_sid}/TaskQueues/#{task_queue_sid}/Statistics"
|
|
128
|
-
response = get path, args, true
|
|
129
|
-
Twilio::REST::TaskRouter::TaskQueueStatistics.new path, self, response
|
|
112
|
+
warn "[DEPRECATED] task_queue_statistics is deprecated. " \
|
|
113
|
+
"Please call client.task_queue.get(sid).statistics."
|
|
114
|
+
task_queues.get(task_queue_sid).statistics
|
|
130
115
|
end
|
|
131
116
|
|
|
132
117
|
##
|
|
133
118
|
# Get statistics of task queues.
|
|
134
119
|
def task_queues_statistics(*args) # :doc:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
warn "[DEPRECATED] task_queues_statistics is deprecated. " \
|
|
121
|
+
"Please call client.task_queues.statistics."
|
|
122
|
+
task_queues.statistics
|
|
138
123
|
end
|
|
139
124
|
|
|
140
125
|
##
|
|
141
126
|
# Get statistics of a worker.
|
|
142
127
|
def worker_statistics(worker_sid, *args) # :doc:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
path = "/#{API_VERSION}/Workspaces/#{@workspace_sid}/Workers/#{worker_sid}/Statistics"
|
|
147
|
-
response = get path, args, true
|
|
148
|
-
Twilio::REST::TaskRouter::WorkerStatistics.new path, self, response
|
|
128
|
+
warn "[DEPRECATED] worker_statistics is deprecated. " \
|
|
129
|
+
"Please call client.worker.get(sid).statistics."
|
|
130
|
+
workers.get(worker_sid).statistics
|
|
149
131
|
end
|
|
150
132
|
|
|
151
133
|
##
|
|
152
134
|
# Get statistics of workers.
|
|
153
135
|
def workers_statistics(*args) # :doc:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
136
|
+
warn "[DEPRECATED] workers_statistics is deprecated. " \
|
|
137
|
+
"Please call client.workers.statistics."
|
|
138
|
+
workers.statistics
|
|
157
139
|
end
|
|
158
140
|
|
|
159
141
|
##
|
|
160
142
|
# Get statistics of a workflow.
|
|
161
143
|
def workflow_statistics(workflow_sid, *args) # :doc:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
path = "/#{API_VERSION}/Workspaces/#{@workspace_sid}/Workflows/#{workflow_sid}/Statistics"
|
|
166
|
-
response = get path, args, true
|
|
167
|
-
Twilio::REST::TaskRouter::WorkflowStatistics.new path, self, response
|
|
144
|
+
warn "[DEPRECATED] workflow_statistics is deprecated. " \
|
|
145
|
+
"Please call client.workflow.get(sid).statistics."
|
|
146
|
+
workflows.get(workflow_sid).statistics
|
|
168
147
|
end
|
|
169
148
|
|
|
170
149
|
##
|
|
171
150
|
# Get statistics of a workspace.
|
|
172
151
|
def workspace_statistics(*args) # :doc:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
152
|
+
warn "[DEPRECATED] worker_statistics is deprecated. " \
|
|
153
|
+
"Please call client.workspace.statistics."
|
|
154
|
+
workspace.statistics
|
|
176
155
|
end
|
|
177
156
|
|
|
178
157
|
protected
|
|
179
158
|
|
|
180
|
-
##
|
|
181
|
-
# Get the default config values.
|
|
182
|
-
def get_defaults
|
|
183
|
-
DEFAULTS
|
|
184
|
-
end
|
|
185
|
-
|
|
186
159
|
##
|
|
187
160
|
# Set up +workspace+ and +workspaces+ attributes.
|
|
188
161
|
def set_up_subresources # :doc:
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module Twilio
|
|
2
|
+
module Util
|
|
3
|
+
class ClientConfig
|
|
4
|
+
DEFAULTS = {
|
|
5
|
+
host: 'api.twilio.com',
|
|
6
|
+
port: 443,
|
|
7
|
+
use_ssl: true,
|
|
8
|
+
ssl_verify_peer: true,
|
|
9
|
+
ssl_ca_file: File.dirname(__FILE__) + '/../../../conf/cacert.pem',
|
|
10
|
+
timeout: 30,
|
|
11
|
+
proxy_addr: nil,
|
|
12
|
+
proxy_port: nil,
|
|
13
|
+
proxy_user: nil,
|
|
14
|
+
proxy_pass: nil,
|
|
15
|
+
retry_limit: 1
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
DEFAULTS.each_key do |attribute|
|
|
19
|
+
attr_accessor attribute
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def initialize(opts={})
|
|
23
|
+
DEFAULTS.each do |attribute, value|
|
|
24
|
+
send("#{attribute}=".to_sym, opts.fetch(attribute, value))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/twilio-ruby/version.rb
CHANGED
data/lib/twilio-ruby.rb
CHANGED
|
@@ -10,6 +10,7 @@ require 'jwt'
|
|
|
10
10
|
|
|
11
11
|
require 'twilio-ruby/version' unless defined?(Twilio::VERSION)
|
|
12
12
|
require 'twilio-ruby/util'
|
|
13
|
+
require 'twilio-ruby/util/client_config'
|
|
13
14
|
require 'twilio-ruby/util/configuration'
|
|
14
15
|
require 'twilio-ruby/util/request_validator'
|
|
15
16
|
require 'twilio-ruby/util/capability'
|
|
@@ -37,6 +38,7 @@ require 'twilio-ruby/rest/sip/credential_lists'
|
|
|
37
38
|
require 'twilio-ruby/rest/sip/credential_lists/credentials'
|
|
38
39
|
require 'twilio-ruby/rest/sip/ip_access_control_lists'
|
|
39
40
|
require 'twilio-ruby/rest/sip/ip_access_control_lists/ip_addresses'
|
|
41
|
+
require 'twilio-ruby/rest/task_router/statistics'
|
|
40
42
|
require 'twilio-ruby/rest/task_router/activities'
|
|
41
43
|
require 'twilio-ruby/rest/task_router/events'
|
|
42
44
|
require 'twilio-ruby/rest/task_router/reservations'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Twilio::Util::ClientConfig do
|
|
4
|
+
Twilio::Util::ClientConfig::DEFAULTS.each do |attribute, value|
|
|
5
|
+
it "sets an attribute with a default value" do
|
|
6
|
+
config = Twilio::Util::ClientConfig.new
|
|
7
|
+
expect(config.send(attribute)).to eq(value)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "can update the value for the attribute" do
|
|
11
|
+
config = Twilio::Util::ClientConfig.new
|
|
12
|
+
config.send("#{attribute}=", "blah")
|
|
13
|
+
expect(config.send(attribute)).to eq("blah")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "can set the value from a hash in the initializer" do
|
|
17
|
+
config = Twilio::Util::ClientConfig.new(attribute => 'blah')
|
|
18
|
+
expect(config.send(attribute)).to eq("blah")
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twilio-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Benton
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: multi_json
|
|
@@ -179,6 +179,7 @@ files:
|
|
|
179
179
|
- lib/twilio-ruby/rest/task_router/activities.rb
|
|
180
180
|
- lib/twilio-ruby/rest/task_router/events.rb
|
|
181
181
|
- lib/twilio-ruby/rest/task_router/reservations.rb
|
|
182
|
+
- lib/twilio-ruby/rest/task_router/statistics.rb
|
|
182
183
|
- lib/twilio-ruby/rest/task_router/task_queues.rb
|
|
183
184
|
- lib/twilio-ruby/rest/task_router/task_queues_statistics.rb
|
|
184
185
|
- lib/twilio-ruby/rest/task_router/tasks.rb
|
|
@@ -200,6 +201,7 @@ files:
|
|
|
200
201
|
- lib/twilio-ruby/twiml/response.rb
|
|
201
202
|
- lib/twilio-ruby/util.rb
|
|
202
203
|
- lib/twilio-ruby/util/capability.rb
|
|
204
|
+
- lib/twilio-ruby/util/client_config.rb
|
|
203
205
|
- lib/twilio-ruby/util/configuration.rb
|
|
204
206
|
- lib/twilio-ruby/util/request_validator.rb
|
|
205
207
|
- lib/twilio-ruby/version.rb
|
|
@@ -228,6 +230,7 @@ files:
|
|
|
228
230
|
- spec/task_router_spec.rb
|
|
229
231
|
- spec/twilio_spec.rb
|
|
230
232
|
- spec/util/capability_spec.rb
|
|
233
|
+
- spec/util/client_config_spec.rb
|
|
231
234
|
- spec/util/configuration_spec.rb
|
|
232
235
|
- spec/util/request_validator_spec.rb
|
|
233
236
|
- spec/util/url_encode_spec.rb
|
|
@@ -289,6 +292,7 @@ test_files:
|
|
|
289
292
|
- spec/task_router_spec.rb
|
|
290
293
|
- spec/twilio_spec.rb
|
|
291
294
|
- spec/util/capability_spec.rb
|
|
295
|
+
- spec/util/client_config_spec.rb
|
|
292
296
|
- spec/util/configuration_spec.rb
|
|
293
297
|
- spec/util/request_validator_spec.rb
|
|
294
298
|
- spec/util/url_encode_spec.rb
|