twilio-ruby 4.4.0 → 4.5.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 +4 -4
- data/lib/twilio-ruby.rb +11 -0
- data/lib/twilio-ruby/rest/pricing/messaging.rb +15 -0
- data/lib/twilio-ruby/rest/pricing/voice.rb +0 -3
- data/lib/twilio-ruby/rest/pricing_client.rb +1 -3
- data/lib/twilio-ruby/rest/trunking/credential_lists.rb +8 -0
- data/lib/twilio-ruby/rest/trunking/ip_access_control_lists.rb +8 -0
- data/lib/twilio-ruby/rest/trunking/origination_urls.rb +8 -0
- data/lib/twilio-ruby/rest/trunking/phone_numbers.rb +8 -0
- data/lib/twilio-ruby/rest/trunking/trunks.rb +19 -0
- data/lib/twilio-ruby/rest/trunking_client.rb +106 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/rest/trunking/trunk_spec.rb +36 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fbf37a3542aa7a3a7cb75eee0c803f0ada09cbc
|
4
|
+
data.tar.gz: 096dd69f1095786ca224a5df6be1495191a81e08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b45a19176a20355ba25981ef95b6999a014e6b5801f7f8c73145eb4724beb41dc82031c5769ff422951cc6567120a200c5886df48ea6c2d962f20282bcae309
|
7
|
+
data.tar.gz: 5bcda0112084afbb89a71df58b4bfdc3c000b5d3860cc0861f7b29e6299fcd4d20b63784995b30b894039ab25678a32847ce645e3e143d70196c5e64821e6bf2
|
data/lib/twilio-ruby.rb
CHANGED
@@ -28,6 +28,12 @@ require 'twilio-ruby/rest/accounts'
|
|
28
28
|
require 'twilio-ruby/rest/calls'
|
29
29
|
require 'twilio-ruby/rest/call_feedback'
|
30
30
|
require 'twilio-ruby/rest/call_feedback_summary'
|
31
|
+
require 'twilio-ruby/rest/pricing'
|
32
|
+
require 'twilio-ruby/rest/pricing/countries'
|
33
|
+
require 'twilio-ruby/rest/pricing/phone_numbers'
|
34
|
+
require 'twilio-ruby/rest/pricing/voice/numbers'
|
35
|
+
require 'twilio-ruby/rest/pricing/voice'
|
36
|
+
require 'twilio-ruby/rest/pricing/messaging'
|
31
37
|
require 'twilio-ruby/rest/sms'
|
32
38
|
require 'twilio-ruby/rest/sms/short_codes'
|
33
39
|
require 'twilio-ruby/rest/sms/messages'
|
@@ -52,6 +58,11 @@ require 'twilio-ruby/rest/task_router/workflow_statistics'
|
|
52
58
|
require 'twilio-ruby/rest/task_router/workflows'
|
53
59
|
require 'twilio-ruby/rest/task_router/workspaces'
|
54
60
|
require 'twilio-ruby/rest/task_router/workspace_statistics'
|
61
|
+
require 'twilio-ruby/rest/trunking/credential_lists.rb'
|
62
|
+
require 'twilio-ruby/rest/trunking/ip_access_control_lists.rb'
|
63
|
+
require 'twilio-ruby/rest/trunking/origination_urls.rb'
|
64
|
+
require 'twilio-ruby/rest/trunking/phone_numbers.rb'
|
65
|
+
require 'twilio-ruby/rest/trunking/trunks.rb'
|
55
66
|
require 'twilio-ruby/rest/lookups/phone_numbers'
|
56
67
|
require 'twilio-ruby/rest/monitor/events'
|
57
68
|
require 'twilio-ruby/rest/monitor/alerts'
|
@@ -1,7 +1,4 @@
|
|
1
1
|
require 'twilio-ruby/rest/base_client'
|
2
|
-
require 'twilio-ruby/rest/pricing'
|
3
|
-
require 'twilio-ruby/rest/pricing/voice'
|
4
|
-
require 'twilio-ruby/rest/pricing/phone_numbers'
|
5
2
|
|
6
3
|
module Twilio
|
7
4
|
module REST
|
@@ -96,6 +93,7 @@ module Twilio
|
|
96
93
|
def set_up_subresources # :doc:
|
97
94
|
@voice = Twilio::REST::Pricing::Voice.new "/#{API_VERSION}/Voice", self
|
98
95
|
@phone_numbers = Twilio::REST::Pricing::PhoneNumbers.new "/#{API_VERSION}/PhoneNumbers", self
|
96
|
+
@messaging = Twilio::REST::Pricing::Messaging.new "/#{API_VERSION}/Messaging", self
|
99
97
|
end
|
100
98
|
|
101
99
|
##
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Twilio
|
2
|
+
module REST
|
3
|
+
module Trunking
|
4
|
+
class Trunks < NextGenListResource; end
|
5
|
+
class Trunk < InstanceResource
|
6
|
+
|
7
|
+
def initialize(path, client, params={})
|
8
|
+
super
|
9
|
+
@submodule = :Trunking
|
10
|
+
resource :credential_lists,
|
11
|
+
:ip_access_control_lists,
|
12
|
+
:origination_urls,
|
13
|
+
:phone_numbers
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'twilio-ruby/rest/base_client'
|
2
|
+
|
3
|
+
module Twilio
|
4
|
+
module REST
|
5
|
+
class TrunkingClient < BaseClient
|
6
|
+
include Twilio::Util
|
7
|
+
include Twilio::REST::Utils
|
8
|
+
|
9
|
+
API_VERSION = 'v1'
|
10
|
+
|
11
|
+
attr_reader :trunks
|
12
|
+
|
13
|
+
host 'trunking.twilio.com'
|
14
|
+
|
15
|
+
##
|
16
|
+
# Instantiate a new HTTP client to talk to Twilio's Trunking API. The
|
17
|
+
# parameters +account_sid+ and +auth_token+ are required, unless you have
|
18
|
+
# configured them already using the block configure syntax, and used to
|
19
|
+
# generate the HTTP basic auth header in each request. The +options+
|
20
|
+
# parameter is a hash of connection configuration options. the following
|
21
|
+
# keys are supported:
|
22
|
+
#
|
23
|
+
# === <tt>host: 'trunking.twilio.com'</tt>
|
24
|
+
#
|
25
|
+
# The domain to which you'd like the client to make HTTP requests. Useful
|
26
|
+
# for testing. Defaults to 'trunking.twilio.com'.
|
27
|
+
#
|
28
|
+
# === <tt>port: 443</tt>
|
29
|
+
#
|
30
|
+
# The port on which to connect to the above domain. Defaults to 443 and
|
31
|
+
# should be left that way except in testing environments.
|
32
|
+
#
|
33
|
+
# === <tt>use_ssl: true</tt>
|
34
|
+
#
|
35
|
+
# Declare whether ssl should be used for connections to the above domain.
|
36
|
+
# Defaults to true and should be left alone except when testing.
|
37
|
+
#
|
38
|
+
# === <tt>ssl_verify_peer: true</tt>
|
39
|
+
#
|
40
|
+
# Declare whether to verify the host's ssl cert when setting up the
|
41
|
+
# connection to the above domain. Defaults to true, but can be turned off
|
42
|
+
# to avoid ssl certificate verification failures in environments without
|
43
|
+
# the necessary ca certificates.
|
44
|
+
#
|
45
|
+
# === <tt>ssl_ca_file: '/path/to/ca/file'</tt>
|
46
|
+
#
|
47
|
+
# Specify the path to the certificate authority bundle you'd like to use
|
48
|
+
# to verify Twilio's SSL certificate on each request. If not specified, a
|
49
|
+
# certificate bundle extraced from Firefox is packaged with the gem and
|
50
|
+
# used by default.
|
51
|
+
#
|
52
|
+
# === <tt>timeout: 30</tt>
|
53
|
+
#
|
54
|
+
# Set the time in seconds to wait before timing out the HTTP request.
|
55
|
+
# Defaults to 30 seconds. If you aren't fetching giant pages of call or
|
56
|
+
# SMS logs you can safely decrease this to something like 3 seconds or
|
57
|
+
# lower. In paricular if you are sending SMS you can set this to 1 second
|
58
|
+
# or less and swallow the exception if you don't care about the response.
|
59
|
+
#
|
60
|
+
# === <tt>proxy_addr: 'proxy.host.domain'</tt>
|
61
|
+
#
|
62
|
+
# The domain of a proxy through which you'd like the client to make HTTP
|
63
|
+
# requests. Defaults to nil.
|
64
|
+
#
|
65
|
+
# === <tt>proxy_port: 3128</tt>
|
66
|
+
#
|
67
|
+
# The port on which to connect to the above proxy. Defaults to nil.
|
68
|
+
#
|
69
|
+
# === <tt>proxy_user: 'username'</tt>
|
70
|
+
#
|
71
|
+
# The user name to use for authentication with the proxy. Defaults to nil.
|
72
|
+
#
|
73
|
+
# === <tt>proxy_pass: 'password'</tt>
|
74
|
+
#
|
75
|
+
# The password to use for authentication with the proxy. Defaults to nil.
|
76
|
+
#
|
77
|
+
# === <tt>retry_limit: 1</tt>
|
78
|
+
#
|
79
|
+
# The number of times to retry a request that has failed before throwing
|
80
|
+
# an exception. Defaults to one.
|
81
|
+
def initialize(*args)
|
82
|
+
super(*args)
|
83
|
+
end
|
84
|
+
|
85
|
+
def inspect # :nodoc:
|
86
|
+
"<Twilio::REST::TrunkingClient @account_sid=#{@account_sid}>"
|
87
|
+
end
|
88
|
+
|
89
|
+
protected
|
90
|
+
|
91
|
+
##
|
92
|
+
# Set up +voice+ and +phone_numbers+ attributes.
|
93
|
+
def set_up_subresources # :doc:
|
94
|
+
@voice = Twilio::REST::Trunking::Trunks.new "/#{API_VERSION}/Trunks", self
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# Builds up full request path
|
99
|
+
def build_full_path(path, params, method)
|
100
|
+
path = path.dup
|
101
|
+
path << "?#{url_encode(params)}" if method == :get && !params.empty?
|
102
|
+
path
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Twilio::REST::Trunking::Trunk do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@trunk = Twilio::REST::Trunking::Trunk.new('someUri', 'someClient')
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'sets up a credential lists resources object' do
|
10
|
+
expect(@trunk).to respond_to(:credential_lists)
|
11
|
+
expect(@trunk.credential_lists.instance_variable_get('@path')).to eq(
|
12
|
+
'someUri/CredentialLists'
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'sets up a ip access control lists resources object' do
|
17
|
+
expect(@trunk).to respond_to(:ip_access_control_lists)
|
18
|
+
expect(@trunk.ip_access_control_lists.instance_variable_get('@path')).to eq(
|
19
|
+
'someUri/IpAccessControlLists'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'sets up a origination urls resources object' do
|
24
|
+
expect(@trunk).to respond_to(:origination_urls)
|
25
|
+
expect(@trunk.origination_urls.instance_variable_get('@path')).to eq(
|
26
|
+
'someUri/OriginationUrls'
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'sets up a phone numbers resources object' do
|
31
|
+
expect(@trunk).to respond_to(:phone_numbers)
|
32
|
+
expect(@trunk.phone_numbers.instance_variable_get('@path')).to eq(
|
33
|
+
'someUri/PhoneNumbers'
|
34
|
+
)
|
35
|
+
end
|
36
|
+
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.
|
4
|
+
version: 4.5.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-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- lib/twilio-ruby/rest/outgoing_caller_ids.rb
|
170
170
|
- lib/twilio-ruby/rest/pricing.rb
|
171
171
|
- lib/twilio-ruby/rest/pricing/countries.rb
|
172
|
+
- lib/twilio-ruby/rest/pricing/messaging.rb
|
172
173
|
- lib/twilio-ruby/rest/pricing/phone_numbers.rb
|
173
174
|
- lib/twilio-ruby/rest/pricing/voice.rb
|
174
175
|
- lib/twilio-ruby/rest/pricing/voice/numbers.rb
|
@@ -204,6 +205,12 @@ files:
|
|
204
205
|
- lib/twilio-ruby/rest/task_router_client.rb
|
205
206
|
- lib/twilio-ruby/rest/tokens.rb
|
206
207
|
- lib/twilio-ruby/rest/transcriptions.rb
|
208
|
+
- lib/twilio-ruby/rest/trunking/credential_lists.rb
|
209
|
+
- lib/twilio-ruby/rest/trunking/ip_access_control_lists.rb
|
210
|
+
- lib/twilio-ruby/rest/trunking/origination_urls.rb
|
211
|
+
- lib/twilio-ruby/rest/trunking/phone_numbers.rb
|
212
|
+
- lib/twilio-ruby/rest/trunking/trunks.rb
|
213
|
+
- lib/twilio-ruby/rest/trunking_client.rb
|
207
214
|
- lib/twilio-ruby/rest/usage.rb
|
208
215
|
- lib/twilio-ruby/rest/usage/records.rb
|
209
216
|
- lib/twilio-ruby/rest/usage/triggers.rb
|
@@ -240,6 +247,7 @@ files:
|
|
240
247
|
- spec/rest/task_router/statistics_spec.rb
|
241
248
|
- spec/rest/task_router/task_queue_spec.rb
|
242
249
|
- spec/rest/token_spec.rb
|
250
|
+
- spec/rest/trunking/trunk_spec.rb
|
243
251
|
- spec/rest/utils_spec.rb
|
244
252
|
- spec/spec_helper.rb
|
245
253
|
- spec/support/fakeweb.rb
|
@@ -309,6 +317,7 @@ test_files:
|
|
309
317
|
- spec/rest/task_router/statistics_spec.rb
|
310
318
|
- spec/rest/task_router/task_queue_spec.rb
|
311
319
|
- spec/rest/token_spec.rb
|
320
|
+
- spec/rest/trunking/trunk_spec.rb
|
312
321
|
- spec/rest/utils_spec.rb
|
313
322
|
- spec/spec_helper.rb
|
314
323
|
- spec/support/fakeweb.rb
|